Next: , Previous: Intrinsic mathematical methods, Up: ncap2 netCDF Arithmetic Processor


4.1.26 Operators precedence and associativity

This page lists the ncap operators in order of precedence (highest to lowest). Their associativity indicates in what order operators of equal precedence in an expression are applied.

Operator Description Associativity
++ -- Postfix Increment/Decrement Right to Left
() Parentheses (function call)
. Method call

++ -- Prefix Increment/Decrement Right to Left
+ - Unary Plus/Minus
! Logical Not

^ Power of Operator Right to Left

* / % Multiply/Divide/Modulus Left To Right

+ - Addition/Subtraction Left To Right

>> << Fortran style array clipping Left to Right


< <= Less than/Less than or equal to Left to Right
> >= Greater than/Greater than or equal to

== != Equal to/Not equal to Left to Right

&& Logical AND Left to Right

|| Logical OR Left to Right

?: Ternary Operator Right to Left

= Assignment Right to Left
+= -= Addition/subtraction assignment
*= /= Multiplication/division assignment