Category: Arithmetic Expressions

The Original Internet Language

Decimals and Rounding

The result of an arithmetic expression contains as many decimal places as are found in the operands of the expression. If the expression contains several operands with varying numbers of decimal places, the result takes on the number of decimal places found in the operand with the most decimal places. If the result of the…
Read more

Arithmetic with Dates

ZIM-X provides a number of built-in functions to perform date and time arithmetic.  If an arithmetic expression subtracts one date from another (i.e., both operands are of data type DATE), the result is a number representing the number of days between the two dates. Example Consider the Date Type values: Date1 = 19990923 (23SEP1999) and…
Read more

How To Construct Arithmetic Expressions

Writing Expressions Arithmetic operators and parentheses can be combined to create long, complex expressions. Arithmetic expressions are evaluated based on the standard rules of precedence. Parentheses alter the order of evaluation. Spaces between operands and operators can be used for clarity, but are not required. For example, Salary * 1.1 and Salary*1.1 are equivalent. Data…
Read more

How To Use Arithmetic Expressions

An arithmetic expression is a complex value expression that consists of two or more value expressions and associated arithmetic operators. The arithmetic operators are + (Add) – (Subtract) ^(Exponentiation) * (Multiply) / (Divide) Examples of Arithmetic Expressions For clarity, spaces can be used between operands and operators, but they are not required. Salary * 1.1…
Read more

Rules of Precedence for Arithmetic Operators

Operator Rule of Precedence Unary + and – Positive (+) and negative (-) signs are evaluated first, e.g., +2 or -Salary. ^ Exponentiation (^) is performed next, e.g., x^y, that is x raised to the power of y.Note: If x is negative, y must be an integer. * and / Multiplication (*) and division (/)…
Read more

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…
Read more

en_CAEnglish