On Sun, Sep 09, 2007 at 09:19:05PM -0500, Joshua Isom wrote: > 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. > > 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.
Not only that, but the C<cmp> op already does exactly what we want (perhaps with the exception of negative infinity or NANs -- I'd have to think about those). cmp I0, N0, 0.0 # $I0 is -1, 0, or 1 At any rate, I'd be against adding a separate set of "sign" opcodes, in favor of just using "cmp" or writing special-purpose subs to handle it. Pm