Expression Operator Precedence

NI VeriStand 2018 Help

Edition Date: May 2018

Part Number: 372846M-01

»View Product Info
Download Help (Windows Only)

The precedence of operators is as follows, from highest to lowest. Operators on the same line all have the same precedence.

** exponentiation
-, !, ~, ++, and –– unary negation, logical not, bit complement, pre- and post-increment, pre- and post-decrement
*, /, % multiplication, division, modulus (remainder)
+ and addition and subtraction
>> and << arithmetic shift right and shift left
>, <, >=, and <= greater, less, greater or equal, and less or equal
!= and == inequality and equality
& bit and
^ bit exclusive or
| bit or
&& logical and
|| logical or
? : conditional evaluation
= op= assignment, shortcut operate and assign
op can be +, , *, /, >>, <<, &, ^, |, %, or **.

The assignment operator = is right associative (groups right to left), as is the exponentiation operator **. All other binary operators are left associative.

The numeric value of TRUE is 1, and FALSE is 0 for output. The logical value of 0 is FALSE, and any nonzero number is TRUE. The logical value of the conditional expression

      <lexpr> ? <texpr>: <fexpr>

is <texpr> if the logical value of <lexpr> is TRUE and <fexpr> otherwise.

Related Links


Not Helpful