# HG changeset patch # User John W. Eaton # Date 1349360459 14400 # Node ID 481417a57a2db269c775f1d1fb9a922655d7166d # Parent ecf5be238b4aa9348d4c87c710b9615c0daed29e improve sign and signbit docs * mappers.cc (Fsign): Note sign (-0) is 0. Add @seealso for signbit. (Fsignbit): Add @seealso for sign. diff -r ecf5be238b4a -r 481417a57a2d libinterp/corefcn/mappers.cc --- a/libinterp/corefcn/mappers.cc Thu Oct 04 09:48:07 2012 -0400 +++ b/libinterp/corefcn/mappers.cc Thu Oct 04 10:20:59 2012 -0400 @@ -1754,6 +1754,11 @@ @end ifnottex\n\ \n\ For complex arguments, @code{sign} returns @code{x ./ abs (@var{x})}.\n\ +\n\ +Note that @code{sign (-0.0)} is 0.\n\ Although IEEE 754 floating point\n\ +allows zero to be signed, 0.0 and -0.0 compare equal. If you must test\n\ +whether zero is signed, use the @code{signbit} function.\n\ +@seealso{signbit}\n\ @end deftypefn") { octave_value retval; @@ -1788,6 +1793,7 @@ This is not the same as @code{x < 0.0}, because IEEE 754 floating point\n\ allows zero to be signed. The comparison @code{-0.0 < 0.0} is false,\n\ but @code{signbit (-0.0)} will return a nonzero value.\n\ +@seealso{sign}\n\ @end deftypefn") { octave_value retval;