# HG changeset patch
# User Michael Godfrey <michaeldgodfrey@gmail.com>
# Date 1361070419 18000
# Node ID 5ab644b58f88bf7fb4b33697c8da3c737989266a
# Parent  0ddc669eef2d49b92aefbd7507baf69fe6033ac9
make signbit return logical 0,1

diff -r 0ddc669eef2d -r 5ab644b58f88 libinterp/corefcn/mappers.cc
--- a/libinterp/corefcn/mappers.cc	Sat Feb 16 21:50:08 2013 -0500
+++ b/libinterp/corefcn/mappers.cc	Sat Feb 16 22:06:59 2013 -0500
@@ -1882,7 +1882,10 @@
 DEFUNX ("signbit", Fsignbit, args, ,
     "-*- texinfo -*-\n\
 @deftypefn {Mapping Function} {} signbit (@var{x})\n\
-Return a nonzero value if the value of @var{x} has its sign bit set.\n\
+Return logical true if the value of @var{x} has its sign bit set.\n\
+Otherwise return logical false.  This behavior is consistent with the other\n\
+logical functions. See@ref{Logical Values}.  The behavior differs from the\n\
+C language function which returns non-zero if the sign bit is set.\n\
 \n\
 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\
@@ -1891,8 +1894,9 @@
 @end deftypefn")
 {
   octave_value retval;
-  if (args.length () == 1)
+  if (args.length () == 1) {
     retval = args(0).xsignbit ();
+    retval = (retval != 0); }
   else
     print_usage ();
 
