Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

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 are 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.