Static Assert
With this Node, mathematical calculations can be performed and logically checked. For this purpose, separate variables for floating point values can be created and filled with static values. This is very useful for logical checks of values, e.g., to confirm whether values are identical, not identical, larger or smaller. Both a logical signal (TRUE or FALSE) and an individual error text can be output if the check failed. Here is a simple example.
All three default inputs are used for variables and assigned the values 1, 2 and 3 in sequence. These values, or their variables, can be used via the terms var1, var2 and var3 in the Condition Field. The following logical checks can be used there:
- Is identical with: The string == can be used to compare two variables or values with each other. If both values are identical, TRUE is output, otherwise FALSE. In our example, for example, the condition (var1+var2)/var3==1 would lead to the Result TRUE.
- Is not identical with: The string != can be used to check whether two values are not equal. Therefore, in our example, the condition var1!=var3-var2 would return the Result FALSE.
- Logical "and": With the string && a logical "and" can be inserted into a condition, e.g., if several conditions must be fulfilled at the same time to get a TRUE result. In our example, for example, var1!=0 && var2+var3==5 could be used to get a TRUE result only if the first variable is not 0 AND the addition of variable 2 and variable 3 gives the value 5.
- Logical "or": With the string || a logical "or" can be inserted into a condition. For example, if either one OR the other condition can be positively checked. In our example, for example, var1==1 || var2==5 could be used and would return a TRUE result, since the value of variable 2 is not 5, but variable 1 contains the value 1.
- Logical "greater than"/"less than": The classic characters > (is greater than) and < (is less than) can be used to compare values.
- Logical "greater than or equal to"/"less than or equal to": The greater/less than comparisons can be extended by an appended = sign to produce a positive result even if the values are equal. In our example, var1+var2>=var3, for example, would return a TRUE result, since the added values, although not greater than variable 3, would yield an identical value.
In addition, the normal basic arithmetic operations +, -, * and /, as well as trigonometric calculations, such as sin (sine), cos (cosine) or their inversions asin and acos can be used. In addition, constants such as pi can also be used for the circular number pi. A complete list of supported trigonometric functions and constants can be found here.
