octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: signbit and logical tests


From: John W. Eaton
Subject: Re: signbit and logical tests
Date: Sat, 09 Feb 2013 21:26:23 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11

On 02/09/2013 09:02 PM, Michael D. Godfrey wrote:
I looked a bit more at the "logical" tests as described in Sections 4.6-8.
If signbit() returned a logical it would fit with "isxxxx" functions and
make more
sense. Referencing Section 4.6 through 4.8 in the signbit() documentation
would then make this all fit together and more understandable.

Is this a useful idea?

The signbit function in Octave is just a simple wrapper around the system library signbit function, and that returns the value of the sign bit as an integer. I don't know whether it would be a good idea to change that definition for Octave. The other function that I know of in Matlab that returns something different from what the C library function returns is strcmp. So there is precedent for that kind of thing. Or, if you want a predicate-style function, maybe we should have isnegative instead?

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]