[Bug fortran/19904] Division by zero leads to error

sgk at troutmask dot apl dot washington dot edu gcc-bugzilla@gcc.gnu.org
Fri Feb 11 21:34:00 GMT 2005


------- Additional Comments From sgk at troutmask dot apl dot washington dot edu  2005-02-11 17:10 -------
Gfortran is a Fortran 95 compiler, and AFAIK gfortran's behavior conforms
to the Fortran 95 standard, because it has no allowance for floating point
exception.  Someday, gfortran may/will support Technical Report ISO/IEC
15580: 1998(E), which will then permit the use of the ieee_arithmetic,
ieee_features, and ieee_exceptions intrinsic modules.

If you want to set a NaN in gfortran you can do,

program test
   real nan
   integer duh
   equivalence (nan,duh)
   duh = z'FFC00000'
   print*, nan
end program test

The question then becomes "what are going to do with NaN?"
I suspect the gfortran's behavior of the numeric rational
operation and numeric binary operation may give undefined
behavior, which is again permitted by the Fortran 95 standard.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19904



More information about the Gcc-bugs mailing list