next up previous contents index
Next: 6.2.4 Referencing Other Cells Up: 6.2 NExS Formulas Previous: 6.2.2 Formula Values

6.2.3 Formula Operators

     

NExS supports all the arithmetic, boolean and logical operators available in the C programming language. It does not support the C address operators or the operators that have side effects, such as ++. NExS provides two operators, exponentiation (**) and percent (%), that are not available in the C language.

NExS Formulas can contain the following operators to define relationship between values.

 

Operator Precedence Definition
% 14 Unary percent
** 13 Exponentiation
+ 12 Unary plus
- 12 Unary minus
~ 12 Bitwise complement (integer)
! 12 Logical not
* 11 Multiplication
/ 11 Division
% 11 Remainder (integer)
+ 10 Addition
- 10 Subtraction
<< 9 Shift left (integer)
>> 9 Shift right (integer)
< 8 Less Than
> 8 Greater Than
<= 8 Less Than or Equal
>= 8 Greater Than or Equal
== 7 Equal
!= 7 Not Equal
& 6 Bitwise And, or String Concatenation
^ 5 Bitwise Exclusive-Or (integer)
| 4 Bitwise Or
&& 3 Logical And
|| 2 Logical Or
?: 1 Conditional
Table 6.1: NExS Operators

 

In formulas with more than one operator, NExS evaluates operators in the order of precedence presented above, with highest precedence first. That is, AND/OR/NOT operators are evaluated after inequality operators in a logical expression, and multiplication/division operations are performed before subtraction/addition operations in an arithmetic expression. Operators at the same precedence level are evaluated from left to right.

The precedence of operators can be overridden by using parentheses to explicitly specify the order of evaluation.

Here are some special notes about NExS operators:


next up previous contents index
Next: 6.2.4 Referencing Other Cells Up: 6.2 NExS Formulas Previous: 6.2.2 Formula Values

NExS User's Guide, Version 1.4.5
Grey Trout Software
11 April 1999