ieee on Windows problem
FX
fxcoudert@gmail.com
Mon Jun 30 19:31:00 GMT 2014
> OK, all of the test programs EXCEPT ieee_2.f90 execute successfully.
Nice!
> ieee_2.f90 crashes on the following line
> if (ieee_class(ieee_logb(-sx1)) /= ieee_positive_inf) call abort
Can you tell me what the following program outputs? (compiled with no optimization and the IEEE flags)
use, intrinsic :: ieee_arithmetic
real :: sx1
sx1 = ieee_value(sx1, ieee_positive_inf)
print *, sx1, -sx1
print *, ieee_logb(sx1), ieee_logb(-sx1)
print *, exponent(sx1), exponent(-sx1)
end
For me, on x86_64-apple-darwin, it shows:
Infinity -Infinity
Infinity Infinity
0 0
which is, by my reading, correct for IEEE_LOGB, but incorrect for the pre-existing EXPONENT intrinsic ("If X is an IEEE infinity or NaN, the result has the value HUGE(0)”).
FX
More information about the Fortran
mailing list