Re: t/op/integer.t is IMHO wrong
At 03:56 PM 9/18/2001 -0700, Damien Neil wrote: On Wed, Sep 19, 2001 at 12:51:43AM +0200, Mattia Barbon wrote: I think that especting 4294967295 == -1 because they have the same bit pattern ( on two's complement 32 bit machines ) is wrong I was wondering how long it would take for someone to notice that. : If anyone feels like defining a policy on what Parrot does with out-of-range numbers, and what happens on integer overflow, I'll submit patches to the tests to check against it. I'd rather we didn't just modify the tests to never trigger overflow conditions, however; that's just sweeping the issue under the rug. Integer and float ops, *on integer and float registers* do undefined things on over/underflow. No guarantees, no promises, no certainty. Price of speed. What they do with PMCs, though, is another matter. Those will convert or throw interpreter exceptions, as appropriate. Dan --it's like this--- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk
t/op/integer.t is IMHO wrong
set I2, -2147483648 print I2 print \\n set I3, 4294967295 print I3 print \\n end CODE 305419896 -1698898191 2147483647 -2147483648 -1 OUTPUT I think that especting 4294967295 == -1 because they have the same bit pattern ( on two's complement 32 bit machines ) is wrong Regards Mattia
Re: t/op/integer.t is IMHO wrong
On Wed, Sep 19, 2001 at 12:51:43AM +0200, Mattia Barbon wrote: I think that especting 4294967295 == -1 because they have the same bit pattern ( on two's complement 32 bit machines ) is wrong I was wondering how long it would take for someone to notice that. : If anyone feels like defining a policy on what Parrot does with out-of-range numbers, and what happens on integer overflow, I'll submit patches to the tests to check against it. I'd rather we didn't just modify the tests to never trigger overflow conditions, however; that's just sweeping the issue under the rug. - Damien
Re: t/op/integer.t is IMHO wrong
On Wed, Sep 19, 2001 at 12:51:43AM +0200, Mattia Barbon wrote: I think that especting 4294967295 == -1 because they have the same bit pattern ( on two's complement 32 bit machines ) is wrong Oh shit, here we go again. Nick Clark, where are you? -- Thus spake the master programmer: After three days without programming, life becomes meaningless. -- Geoffrey James, The Tao of Programming