ieee_scalb

Date:

10-12-2011

NAME

IEEE_SCALB - Returns x multiplied by 2**i

SYNOPSIS

IEEE_SCALB ([X=]x [,[I=]i])

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

Fortran

IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION

The IEEE_SCALB intrinsic function returns x multiplied by the value 2i for integral values of i without computing 2i.

This function accepts the following arguments:

x

Must be of type real.

i

Must be of type integer.

IEEE_SCALB is an elemental function. The name of this intrinsic cannot be passed as an argument.

NOTES

The IEEE intrinsic procedures use the named constants contained in a system module, so you must include the following statement in your program:

USE, INTRINSIC :: IEEE_ARITHMETIC

IEEE_SCALB(X) shall not be invoked if IEEE_SUPPORT_DATATYPE(x) returns the value false.

RETURN VALUES

The return value is of the same type and type parameter as y. The result may be:

  • If x* 2i is a normal number, the result has the value of y multiplied by 2i.

  • If x is finite and x * 2i is too large, the IEEE_OVERFLOW exception will occur. If IEEE_SUPPORT_INF(x) is true, the result value is infinity with the sign of x; otherwise, the result value is SIGN(HUGE(x),x).

  • If x* 2i is too small and there is a loss of accuracy, the IEEE_UNDERFLOW exception shall occur. The result is the representable number having a magnitude nearest to the |( 2i)| and the same sign as x.

  • If x is finite, the result is the same as x; no exception signals.

EXAMPLES

Example 1:

USE, INTRINSIC :: IEEE_ARITHMETIC
REAL   small, bigger

   !Compute small
bigger = IEEE_SCALB(small, 2)

SEE ALSO

scalb(3c), ieee_support_datatype(3i)