Rules for Mathematical Expressions
This topic summarizes the rules for defining and applying mathematical expressions using the Math Expression Builder (these rules apply to all data formats including Channel, Grid and Voxel). These rules include operator precedence, locations, and working with Dummy (placeholder) values.
Operator Precedence
By definition, operators are symbols used to compare left hand and right hand variables or operands in expressions. In math tools, the standard programming hierarchy of operands is observed.
In the following list, each operator is shown in decreasing order of precedence. For some operators, there is also a left-to-right order for evaluating them.
Precedence |
Operator |
Definition |
Location |
1 |
|
Parentheses |
Common Keys |
2 |
F() |
Function |
|
3 |
|
Logical NOT operator |
Frequent Tab |
4 |
|
Exponent |
Common Keys |
5 |
|
Division, multiplication, modular division |
Common Keys |
6 |
|
Plus, minus |
Common Keys |
7 |
|
Greater than, greater than or equal to, less than, less than or equal to |
Frequent Tab |
8 |
|
Equal to, not equal to |
Frequent Tab |
9 |
|
Logical AND operator |
Frequent Tab |
10 |
|
Logical OR operator |
Frequent Tab |
11 |
|
True/false operator used with the statement preceding it. |
Frequent Tab |
Rules for Using Dummy (Placeholder) Values
In the binary arithmetic and logical operations stated below, if a term on either side of the operation is undefined or if the operation yields an undefined value, the outcome is undefined and hence set to Dummy. For example, division by 0 is not defined, hence the outcome will be Dummy.
Binary arithmetic:,
,
,
Binary logical:,
,
,
The operators,
are cognisant of the Dummy in order to be able to perform operations such as:
A = (B==DUMMY), which will set A to 1 if B is Dummy, and 0 if it is not.
Got a question? Visit the Seequent forums or Seequent support
© 2023 Seequent, The Bentley Subsurface Company
Privacy | Terms of Use