Mathematical Functions
Mathematical functions take numeric arguments and produce numeric results.
-
ABS(X)
Results in the absolute value ofX
. -
EXP(EXPONENT)
Returns e (approximately 2.71828) raised to powerEXPONENT
. -
LG10(X)
Takes the base-10 logarithm ofX
. IfX
is not positive, the result is system-missing. -
LN(X)
Takes the base-e logarithm ofX
. IfX
is not positive, the result is system-missing. -
LNGAMMA(X)
Yields the base-e logarithm of the complete gamma ofX
. IfX
is a negative integer, the result is system-missing. -
MOD(A, B)
Returns the remainder (modulus) ofA
divided byB
. IfA
is 0, then the result is 0, even ifB
is missing. IfB
is 0, the result is system-missing. -
MOD10(X)
Returns the remainder whenX
is divided by 10. IfX
is negative,MOD10(X)
is negative or zero. -
RND(X [, MULT[, FUZZBITS]])
RoundsX
and rounds it to a multiple ofMULT
(by default 1). Halves are rounded away from zero, as are values that fall short of halves by less thanFUZZBITS
of errors in the least-significant bits of X. IfFUZZBITS
is not specified then the default is taken fromSET FUZZBITS
, which is 6 unless overridden. -
SQRT(X)
Takes the square root ofX
. IfX
is negative, the result is system-missing. -
TRUNC(X [, MULT[, FUZZBITS]])
RoundsX
to a multiple ofMULT
, toward zero. For the defaultMULT
of 1, this is equivalent to discarding the fractional part ofX
. Values that fall short of a multiple ofMULT
by less thanFUZZBITS
of errors in the least-significant bits ofX
are rounded away from zero. IfFUZZBITS
is not specified then the default is taken fromSET FUZZBITS
, which is 6 unless overridden.