EGL library MathLib

The next table lists the functions in the system library MathLib.
Note: The field numericField is of type BIGINT, BIN, DECIMAL, HEX, INT, NUM, NUMC, PACF, SMALLINT, FLOAT, or SMALLFLOAT.

A field of type HEX (length 8) is assumed to be a single-precision, 4-byte floating-point number that is native to the runtime environment; and a field of type HEX (length 16) is assumed to be a double-precision, 8-byte floating-point number that is native to the runtime environment.

System function/Invocation Description
result = abs (numericField) Returns absolute value of numericField
result = acos (numericField) Returns arccosine of numericField
result = asin (numericField) Returns arcsine of numericField
result = atan (numericField) Returns arctangent of numericField
result = atan2 (numericField1, numericField2) Computes the principal value of the arc tangent of numericField1/numericField2, using the signs of both arguments to determine the quadrant of the return value
result = ceiling (numericField) Returns smallest integer not less than numericField
result = compareNum (numericField1, numericField2) Returns a result (-1, 0, or 1) that indicates whether numericField1 is less than, equal to, or greater than numericField2
result = cos (numericField) Returns cosine of numericField
result = cosh (numericField) Returns hyperbolic cosine of numericField
result = exp (numericField) Returns exponential value of numericField
result = floatingAssign (numericField) Returns numericField as a double-precision floating-point number
result = floatingDifference (numericField1, numericField2) Returns the difference between numericField1 and numericField2
result = floatingMod (numericField1, numericField2) Calculates the floating point remainder of numericField1 divided by numericField2, with the result having the same sign as numericField1
result = floatingProduct (numericField1, numericField2) Returns product of numericField1 and numericField2
result = floatingQuotient (numericField1, numericField2) Returns quotient of numericField1 divided by numericField2
result = floatingSum (numericField1, numericField2) Returns sum of numericField1 and numericField2
result = floor (numericField) Returns the largest integer not greater than numericField
result = frexp (numericField, integer) Splits a number into a normalized fraction in the range of .5 to 1 (which is the returned value) and a power of 2 (which is returned in integer
result = Ldexp (numericField, integer) Returns numericField multiplied by 2 to the power of integer
result = log (numericField) Returns the natural logarithm of numericField
result = log10 (numericField) Returns the base 10 logarithm of numericField
result = maximum (numericField1, numericField2) Returns the greater of numericField1 and numericField2
result = minimum (numericField1, numericField2) Returns the lesser of numericField1 and numericField2
result = modf (numericField1, numericField2) Splits numericField1 into integral and fractional parts, both with the same sign as numericField1; places the integral part in numericField2; and returns the fractional part
result = pow (numericField1, numericField2) Returns numericField1 raised to the power of numericField2
result = precision (numericField) Returns the maximum precision (in decimal digits) for numericField
result = round (numericField[, integer])

result = mathLib.round(numericExpression)

Rounds a number or expression to a nearest value (for example, to the nearest thousands) and returns the result
result = sin (numericField) Returns sine of numericField
result = sinh (numericField) Returns hyperbolic sine of numericField
result = sqrt (numericField) Returns the square root of numericField if numericField is greater than or equal to zero
result = stringAsDecimal (numberAsText) Accepts a character value (like "98.6") and returns the equivalent value of type DECIMAL
result = stringAsFloat (numberAsText) Accepts a character value (like "98.6") and returns the equivalent value of type FLOAT
result = stringAsInt (numberAsText) Accepts a character value (like "98") and returns the equivalent value of type BIGINT
result = tan (numericField) Returns the tangent of numericField
result = tanh (numericField) Returns the hyperbolic tangent of numericField
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.