Visible to Intel only — GUID: GUID-78C33CE1-C645-451B-BDE2-B95F2C1670DC
Visible to Intel only — GUID: GUID-78C33CE1-C645-451B-BDE2-B95F2C1670DC
EXPONENT
Elemental Intrinsic Function (Generic): Returns the exponent part of the argument when represented as a model number.
result = EXPONENT (x)
x |
(Input) must be of type real. |
The result type is default integer. If x is not equal to zero, the result value is the exponent part of x. The exponent must be within default integer range; otherwise, the result is undefined.
If x is zero, the exponent of x is zero. For more information on the exponent part ( e) in the real model, see Model for Real Data.
EXPONENT (2.0) has the value 2.
If 4.1 is a REAL(4) value, EXPONENT (4.1) has the value 3.
The following shows another example:
REAL(4) r1, r2
REAL(8) r3, r4
r1 = 1.0
r2 = 123456.7
r3 = 1.0D0
r4 = 123456789123456.7
write(*,*) EXPONENT(r1) ! prints 1
write(*,*) EXPONENT(r2) ! prints 17
write(*,*) EXPONENT(r3) ! prints 1
write(*,*) EXPONENT(r4) ! prints 47
END