exponent(x)
returns the value of the exponent part of x
. If x
is zero the value returned is zero.
Fortran 95 and later
result = exponent(x)
x
- The type shall be real
.The return value is of type default integer
.
program test_exponent
real :: x = 1.0
integer :: i
i = exponent(x)
print *, i
print *, exponent(0.0)
end program test_exponent