exp (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

3.10 / 1.00.00


This function will calculate the base-e exponential function of the argument, eV.

 

Note: This function works with DOUBLE, but can also work with FLOAT as described in the Floating-point math introductory section.

 

Input:

V : DOUBLE

Value of exponent.

 

Returns: DOUBLE

The exponential value of V. If the value is larger than can be represented, Infinity is returned.

 

Declaration:

FUNCTION exp : DOUBLE;
VAR_INPUT
v : DOUBLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
INCLUDE math.inc
 
PROGRAM test;
 
DebugMsg( message := "e^5 = " + doubleToStr(v := exp(v:=5.0)));
DebugMsg( message := "2^5 = " + doubleToStr(v := exp2(v:=5.0)));
 
 
END_PROGRAM;