Intel® Fortran Compiler 17.0 Developer Guide and Reference

IEEE_LOGB

Elemental Module Intrinsic Function (Generic): Returns a floating-point value equal to the unbiased exponent of the argument. This is equivalent to the IEEE logb function.

Module

USE, INTRINSIC :: IEEE_ARITHMETIC

result = IEEE_LOGB (x)

x

(Input) Must be of type REAL.

Results

The result type and kind is the same as x. The result has the value of the unbiased exponent of x if the value of x is not zero, infinity, or NaN. The value of the result is equal to EXPONENT(x) - 1.

If x is equal to 0, the result is -infinity if IEEE_SUPPORT_INF(x) is true; otherwise, -HUGE(x). In either case, the IEEE_DIVIDE_BY_ZERO exception is signaled.

Example

IEEE_LOGB (3.4) has the value 1.0; IEEE_LOGB (4.0) has the value 2.0.

See Also