fortran - The minimum and maximum floating point exponent of a real number -
how can minimum , maximum exponent 32- , 64-bit real numbers? doing work avoid underflows , overflows , need know numbers.
i need base floating point numbers.
is possible in fortran equivalent of ilmach?
for non-zero reals, numeric model looks s*b^e*\sum_{k=1}^{p}f_k*b^{-k}.
to value of base b use radix(). minimum , maximum values of exponent e can found exponent combined tiny , huge.
use, intrinsic :: iso_fortran_env, : real32, real64 print 1, "real32", radix(1._real32), exponent(tiny(1._real32)), exponent(huge(1._real32)) print 1, "real64", radix(1._real64), exponent(tiny(1._real64)), exponent(huge(1._real64)) 1 format (a," has radix ", i0, " exponent range ", i0, " ", i0, ".") end
Comments
Post a Comment