EXP scalar function

The EXP function returns a value that is the base of the natural logarithm (e) raised to a power specified by the argument. The EXP and LN functions are inverse operations.

Read syntax diagramSkip visual syntax diagramEXP(expression)

The schema is SYSIBM. (The SYSFUN version of the EXP function continues to be available.)

expression
An expression that returns a value of any built-in numeric data type. If the value is of decimal floating-point data type, the operation is performed in decimal floating-point; otherwise, the value is converted to double-precision floating-point for processing by the function.

If the argument is DECFLOAT(n), the result is DECFLOAT(n); otherwise, the result is a double-precision floating-point number. If the argument can be null, the result can be null; if the argument is null, the result is the null value.

Notes

  • Results involving DECFLOAT special values: For decimal floating-point values, the special values are treated as follows:
    • EXP(NaN) returns NaN.
    • EXP(-NaN) returns -NaN.
    • EXP(Infinity) returns Infinity.
    • EXP(-Infinity) returns 0.
    • EXP(sNaN) returns NaN and a warning.
    • EXP(-sNaN) returns -NaN and a warning.

Example

Assume that E is a DECIMAL(10,9) host variable with a value of 3.453789832.
   VALUES EXP(:E)
Returns the DOUBLE value +3.16200000069145E+001.