Arithmetic operations

Evaluated expressions may be assigned to a sortword variable, i.e. a word, long or float type variable.

C precedence determines the order in which operations are performed in the absence of parentheses. Up to 6 nested pairs of parentheses are allowed.

A floating point randomised value in the range 0.0 to 1.0 may be obtained by specifying the reserved float variable RANDOM. A random integer value in the range 0 to 32767 may be accessed using the reserved word IRANDOM.

Arithmetic Operators

Maths functions

The argument should be specified in parentheses following the function name.

Example

... + EXP( A + ( B * X )) ...

Command Functions

returns the value of the group number of group identifier $-word e.g. group($x).

returns the number of items in the group identifier $-word.

returns the value of expression1 to the power expression2.

returns the length of the named list present in the current event.

returns the contents of an array location where the array must be initialised using VALUEARRAY in the *DATA section. Each channel can be specified by a sortword or integer constant.

returns the contents of a spectrum location defined in the *SPECTRA section. Each channel can be specified by a sortword or integer constant.

returns the contents of a data location defined in the *FORMATS section. Each item can be specified by a sortword or integer constant.

evaluates the number of bits set in the 16-bit expression.

evaluates 2 16-bit group-item parameters or sortwords as a 32-bit integer, and 3 or 4 16-bit words as a 64-bit integer (longlong).

evaluates the 64-bit absolute timestamp associated with variable, which has to be a raw data group-item parameter. The value is returned as a LONGLONG data type. Currently only supported for GREAT TDR format input data.