Arithmetic Expressions

Arithmetic Expressions

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

Arithmetic Expressions

Arithmetic expressions use arithmetic operators to combine operands (typically value expressions). When evaluated, these arithmetic expression yield a numeric result, if possible.

Operator

Meaning

+

Positive sign (unary +); addition

Negative sign (unary -); subtraction

^

Exponentiation

*

Multiplication

/

Division

Note: If the ^ character is unavailable, you can substitute **.

The standard rules of precedence for arithmetic evaluation are used.

Examples of arithmetic expressions follow:

Salary * 1.1

Salary + (Salary*0.1)

(! + InterestRate)^Years

The data types (CHAR, NUMERIC, INT, and so on) of the operands used in an arithmetic expression can be mixed. Operands that are character strings are translated (if possible) into an equivalent number, as shown below:

‘/’ evaluates to 0

‘-2’ + 5 evaluates to 3

‘2’ * ‘-4’ evaluates to -8

If a character string cannot be translated into a number (e.g., abcd), then an error message is returned, or the operand is treated as if it were zero.

Was this article helpful?
5 out of 5 stars

1 rating

5 Stars 100%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish