Elemental Intrinsic Function (Generic): Computes an exponential value.
Syntax
result = EXP (x)
x
(Input) Must be of type real or complex.
Results
The result type is the same as x. The value of the result is ex. If x is of type complex, its imaginary part is regarded as a value in radians.
Specific Name | Argument Type | Result Type |
---|---|---|
EXP | REAL(4) | REAL(4) |
DEXP | REAL(8) | REAL(8) |
QEXP | REAL(16) | REAL(16) |
CEXP 1 | COMPLEX(4) | COMPLEX(4) |
CDEXP 2 | COMPLEX(8) | COMPLEX(8) |
CQEXP | COMPLEX(16) | COMPLEX(16) |
1 The setting of compiler options specifying real size can affect CEXP. 2 This function can also be specified as ZEXP. |
See Also
Examples
EXP (2.0) has the value 7.389056.
EXP (1.3) has the value 3.669297.
The following shows another example:
! Given initial size and growth rate,
! calculates the size of a colony at a given time.
REAL sizei, sizef, time, rate
sizei = 10000.0
time = 40.5
rate = 0.0875
sizef = sizei * EXP (rate * time)
WRITE (*, 100) sizef
100 FORMAT (' The final size is ', E12.6)
END