set_exponent(3f) - [FORTRAN:INTRINSIC:MODEL_COMPONENTS] Set the exponent of the model
result = set_exponent(x, i)
set_exponent(x, i) returns the real number whose fractional part is that of X and whose exponent part is I.
X Shall be of type REAL. I Shall be of type INTEGER.
The return value is of the same type and kind as X. The real number whose fractional part is that that of X and whose exponent part if I is returned; it is fraction(x) * radix(x)**i.
Sample program:
program demo_setexp implicit none real :: x = 178.1387e-4 integer :: i = 17 print *, set_exponent(x, i), fraction(x) * radix(x)**i end program demo_setexp
[[Fortran 95]] and later
[[Elemental procedure|Elemental function]]
set_exponent (3) | March 11, 2021 |