This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/19904] Division by zero leads to error
- From: "sgk at troutmask dot apl dot washington dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Feb 2005 17:10:26 -0000
- Subject: [Bug fortran/19904] Division by zero leads to error
- References: <20050211130530.19904.schnetter@aei.mpg.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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