SCALE intrinsic function
Standard: F77 F90 F95 F2003 F2008
 Example Program

SCALE ( X, I )

X : Real with any kind;
I : Integer with any kind;

Result : same type and kind as X.


The result is the value X*RADIX(X)**I without computing RADIX(X)**I directly; that is, even if I is less than MINEXPONENT(X) or greater than MAXEXPONENT(X), so that RADIX(X)**I would be out of range (underflow or overflow), as long as X*RADIX(X)**I is not out of range there is no underflow or overflow.

Like many intrinsic functions, this is elemental; the result has the same shape as X, with the operation being applied elementwise.

MAXEXPONENT intrinsic function, MINEXPONENT intrinsic function, RADIX intrinsic function, REAL type, SET_EXPONENT intrinsic function.