wiki:Doc/panc/dml/operators

Version 11 (modified by /O=GRID-FR/C=FR/O=CNRS/OU=LAL/CN=Charles Loomis, 17 years ago) (diff)

--

Operators

The operators available in the pan Data Manipulation Language (DML) are very similar to those in the C language. The following tables summarize the DML operators. The valid primitive types for each operator are indicated. Those marked with "number" will take either long or double arguments. In the case of binary operators, the result will be promoted to a double if the operands are mixed.

Unary DML Operators

+ number preserves sign of argument
- number changes sign of argument
~ long bit-wise not
! boolean logical not

Binary DML Operators

+ number addition
+ string string concatenation
- number subtraction
* number multiplication
/ number division
% long modulus
& long bit-wise and
| long bit-wise or
^ long bit-wise exclusive or
&& boolean logical and (short-circuit logic)
| | boolean logical or (short-curcuit logic)
== number equal
== string lexical equal
!= number not equal
!= string lexical not equal
> number greater-than
> string lexical greater-than
>= number greater-than-or-equal
>= string lexical greater-than-or-equal
< number less-than
< string lexical less-than
<= number less-than-or-equal
<= string lexical less-than-or-equal

Operator Precedence

| | lowest
&&
|
^
&
==, !=
<, <=, >, >=
+ (binary), - (binary)
*, /, %
+ (unary), - (unary), !, ~ highest