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


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

Result : same type and kind as X.


The result is the value obtained by taking the mantissa of X with an exponent value of I; this is equal to SCALE(X,I−EXPONENT(X)) except for IEEE infinities and NaNs, where the result is a NaN. (An alternative formulation would be FRACTION(X)*REAL(RADIX(X))**I.)

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

EXPONENT intrinsic function, FRACTION intrinsic function, MAXEXPONENT intrinsic function, MINEXPONENT intrinsic function, RADIX intrinsic function, SCALE intrinsic function, REAL type.