On Sep 9, 2007, at 6:40 PM, Doug McNutt wrote:
At 21:16 +0100 9/9/07, Nicholas Clark wrote:
On Sun, Sep 09, 2007 at 10:56:20AM -0700, Jrg Plate wrote:
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=45309 >
This patch implements the sign function for I, N, BigInt and Complex
numbers.
What should the sign of a NaN be? undef?
Some, if not most, NAN's do have a sign. Positive overflow (infinity)
and negative overflow are examples that certainly are signed
quantities.
The sign of zero, where there really are two bit patterns representing
minus and plus zero, has been discussed and there might already be a
resolution.
NAN's only apply to floats. I can imagine a user-invented NaN that
includes positive and negative versions. I would just return the sign
bit from the left end of the binary.
A better question might be just what is meant by the sign of a complex
pair.
--
--> From the U S of A, the only socialist country that refuses to
admit it. <--
I'm curious as to why these ops should be added. These things can
easily be done with PIR, and any compiler can auto generate the code
for that.
A complex pair doesn't have a sign, it has two. But then again, it as
an absolute value that's convoluted.