This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/49336] ATAN2 values differ from those specified in documentation
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 9 Jun 2011 02:44:52 +0000
- Subject: [Bug libfortran/49336] ATAN2 values differ from those specified in documentation
- Auto-submitted: auto-generated
- References: <bug-49336-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49336
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #1 from kargl at gcc dot gnu.org 2011-06-09 02:44:07 UTC ---
The documentation is correct for a Fortran 95 compiler. Try
adding -std=f95 to your command line.
gfortran implements most of the Fortran 2003 and some Fortran
2008 features. With F2003, one finds in Sec. 1.6.1.
If the processor can distinguish between positive and negative
real zero, this standard requires different returned values for
ATAN2(Y,X) when X < 0 and Y is negative real zero and for LOG(X)
and SQRT(X) when X is complex with REAL(X) < 0 and negative zero
imaginary part.
If you want to be hero, you are more than welcomed to submit a
patch. F2003 says the results are
If Y = 0 and X > 0, the result is Y. If Y = 0 and X < 0, then
the result is pi if Y is positive real zero or the processor
cannot distinguish between positive and negative real zero, and
âpi if Y is negative real zero.