Skip to main content

EXP

Returns e (the base of natural logarithms) raised to a power.

Synopsis

EXP(number)

Arguments

number An expression that resolves to a number within the following range: On a Windows system, if the value of number is greater than 335.601, a <MAXNUMBER> error occurs; if the value of number is less than -295.424, EXP returns zero (0).

Description

The EXP function takes the natural log constant e and raises it to the power specified by the number argument. The constant e (EXP(1)) is approximately 2.718282. If number is 0, the null string (""), or a non-numeric value, EXP parses number as 0 and returns 1.

The EXP function complements the action of the LN function and is sometimes referred to as the antilogarithm.

In ObjectScript, the corresponding function is $ZEXP.

Examples

The following example uses the EXP function to calculate e raised to the power of each of the integers -10 through 10:

FOR x = -10 TO 10
PRINT "Natural log to the power of ",x," = ",EXP(x)
NEXT

The following example uses the EXP function to return the hyperbolic sine of an angle:

MyAngle = 1.3
        ! Define angle in radians.
MyHSin = (EXP(MyAngle) - EXP(-1 * MyAngle)) / 2
        ! Calculate hyperbolic sine.
PRINT MyHSin

See Also

FeedbackOpens in a new tab