[perl #59336] [BUG] Parrot fails integer comparisons when integers are 2^31 apart

2008-09-27 Thread Christoph Otto via RT
On Thu Sep 25 14:18:40 2008, julianalbo wrote:
  I suspect the problem is that the integer greater than operation
  is performing a subtraction between the two (signed long) values
  being compared, but the result of the subtraction is outside of
  the range of signed longs.
 
 Correct. Fixed in r31419
 


chromatic added a test for this in r31420, so I'm marking it resolved.


[perl #59336] [BUG] Parrot fails integer comparisons when integers are 2^31 apart

2008-09-25 Thread Patrick R. Michaud (via RT)
# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #59336]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=59336 


Code says it all:

$ cat w.pir
.sub main
$P0 = new 'Integer'
$P0 = 2147483600

  test_10:
print $P0
print  is
if $P0  -10 goto skip_10
print  not
  skip_10:
say  greater than -10

  test_1000:
print $P0
print  is
if $P0  -1000 goto skip_1000
print  not
  skip_1000:
say  greater than -1000
.end
$ ./parrot w.pir
2147483600 is greater than -10
2147483600 is not greater than -1000
$


I suspect the problem is that the integer greater than operation
is performing a subtraction between the two (signed long) values 
being compared, but the result of the subtraction is outside of 
the range of signed longs.

Pm


Re: [perl #59336] [BUG] Parrot fails integer comparisons when integers are 2^31 apart

2008-09-25 Thread NotFound
 I suspect the problem is that the integer greater than operation
 is performing a subtraction between the two (signed long) values
 being compared, but the result of the subtraction is outside of
 the range of signed longs.

Correct. Fixed in r31419

-- 
Salu2