Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Precedence of Operators in Formula Nodes and Expression Nodes

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

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

** exponentiation
+, -, !, ~, ++, and –– unary plus, unary negation, logical not, bit complement, pre- and post-increment, pre- and post-decrement

++ and –– are not available in Expression Nodes.
*, /, % 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 **.

= op= is not available in Expression Nodes.
, x**y.

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.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit