[Bug fortran/51569] documentation on sign intrinsic
kargl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jan 15 18:06:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51569
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
--- Comment #4 from kargl at gcc dot gnu.org 2012-01-15 18:03:05 UTC ---
(In reply to comment #0)
> The documentation of the sign intrinsic is a bit misleading when the B argument
> is a signed zero. The explanation in the standard is much more clearer.
>
> Currently it says
> (http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gfortran/SIGN.html#SIGN):
> "If B\ge 0 then the result is ABS(A), else it is -ABS(A)."
>
> According to the standard -0.0 is greater than zero. Meaning that according to
> the documentation I would expect:
> sign(1.0,-0.0) = 1.0
> which is not true.
>
> I would replace the sentence above by what you can find in the standard:
The documentation as written is fine. It seems that you
are reading 'B \ge 0' in gfortran's documentation as a
Fortran expression instead of as a mathematical expression.
>From the point of view of mathematics if B = -0., then
B is less than 0.; otherwise, the foundations of calculus
would not apply when taking a limit of a function at 0.
Closing as WONTFIX.
More information about the Gcc-bugs
mailing list