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

../../../../geohelp/image/Freq_021.jpg,../../../../geohelp/image/Freq_022.jpg

Parentheses

Common Keys

    2

F()

Function

 

    3

../../../../geohelp/image/Freq_012.jpg 

Logical NOT operator

Frequent Tab

    4

../../../../geohelp/image/Freq_007.jpg 

Exponent

Common Keys

    5

../../../../geohelp/image/Freq_001.jpg,../../../../geohelp/image/Freq_002.jpg,../../../../geohelp/image/Freq_005.jpg
evaluated left to right

Division, multiplication, modular division

Common Keys

    6

../../../../geohelp/image/Freq_004.jpg,../../../../geohelp/image/Freq_003.jpg
evaluated left to right

Plus, minus

Common Keys

    7

../../../../geohelp/image/Freq_009.jpg,../../../../geohelp/image/Freq_011.jpg,../../../../geohelp/image/Freq_008.jpg,../../../../geohelp/image/Freq_010.jpg
evaluated left to right

Greater than, greater than or equal to, less than, less than or equal to

Frequent Tab

    8

../../../../geohelp/image/Freq_013.jpg,../../../../geohelp/image/Freq_014.jpg
evaluated left to right

Equal to, not equal to

Frequent Tab

    9

../../../../geohelp/image/Freq_015.jpg

Logical AND operator

Frequent Tab

   10

../../../../geohelp/image/Freq_016.jpg

Logical OR operator

Frequent Tab

   11


True/false operator used with the statement preceding it.
If/Then/Else Statement

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:   ../../../../geohelp/image/Freq_004.jpg,
				../../../../geohelp/image/Freq_003.jpg,
				../../../../geohelp/image/Freq_002.jpg,
			../../../../geohelp/image/Freq_001.jpg
Binary logical: ../../../../geohelp/image/Freq_008.jpg,  ../../../../geohelp/image/Freq_009.jpg, ../../../../geohelp/image/Freq_010.jpg, ../../../../geohelp/image/Freq_011.jpg
The operators ../../../../geohelp/image/Freq_013.jpg,
			../../../../geohelp/image/Freq_014.jpg  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.