Caché Basic Reference
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   

Returns e (the base of natural logarithms) raised to a power.
The number argument can be any valid numeric expression. On a Windows system, if the value of number is greater than 335, a runtime error occurs; if the value of number is less than -295, Exp returns zero (0).
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.
The Exp function complements the action of the Log function and is sometimes referred to as the antilogarithm.
In ObjectScript, the corresponding function is $ZEXP.
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
Println "Natural log of ",x," = ",Exp(x)
The following example uses the Exp function to return the hyperbolic sine of an angle:
Dim MyAngle, MyHSin  ' Define angle in radians.
MyAngle = 1.3        ' Calculate hyperbolic sine.
MyHSin = (Exp(MyAngle) - Exp(-1 * MyAngle)) / 2
Println MyHSin
See Also