Precedence of Operators in Formula Nodes and Expression Nodes

LabVIEW 2018 Help

Edition Date: March 2018
Part Number: 371361R-01
View Product Info LabVIEW 2016 Help LabVIEW 2017 Help LabVIEW 2018 Help LabVIEW 2019 Help LabVIEW 2020 Help

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.

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. Note  You can use Formula Node most effectively if you are familiar with the C programming language. LabVIEW Help assumes you are familiar with C and does not contain any topics related to programming in C. Refer to The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie or Teach Yourself C by Herbert Schildt for more information.