Skip Menu |
Report information
Id: 126942
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: zefram [at] fysh.org
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
From: Zefram <zefram [...] fysh.org>
Date: Thu, 17 Dec 2015 02:41:00 +0000
Subject: [BUG] large right-shift of negative loses sign
Download (untitled) / with headers
text/plain 369b
Long right shifts (longer than operand length) of negative integers should always produce -1, but in Rakudo after some length they stop doing that and switch to an incorrect output: Show quoted text
> -123 +> 8
-1 Show quoted text
> -123 +> 31
-1 Show quoted text
> -123 +> 32
0 Show quoted text
> -123 +> (1 +< 60)
0 Some very long right shifts then run into [perl #126940] and [perl #126941], but those are separate issues. -zefram
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: "Zefram (via RT)" <perl6-bugs-followup [...] perl.org>
Date: Thu, 17 Dec 2015 16:31:06 +0100
Subject: Re: [perl #126942] [BUG] large right-shift of negative loses sign
Download (untitled) / with headers
text/plain 883b
Show quoted text
> On 17 Dec 2015, at 03:41, Zefram (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by Zefram > # Please include the string: [perl #126942] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=126942 > > > > Long right shifts (longer than operand length) of negative integers > should always produce -1, but in Rakudo after some length they stop > doing that and switch to an incorrect output: >
>> -123 +> 8
> -1
>> -123 +> 31
> -1
>> -123 +> 32
> 0
>> -123 +> (1 +< 60)
> 0 > > Some very long right shifts then run into [perl #126940] and [perl > #126941], but those are separate issues.
$ 6 'say -123 +> 32' -1 Temporarily fixed with 0e24208abfcc67b22a7f , test added with 83057c9b8f97ed9b761f1 , should probably get a better fix at nqp level post Christmas. Or not. Liz
To: Elizabeth Mattijsen <liz [...] dijkmat.nl>
From: Parrot Raiser <1parrota [...] gmail.com>
CC: "Zefram (via RT)" <perl6-bugs-followup [...] perl.org>
Subject: Re: [perl #126942] [BUG] large right-shift of negative loses sign
Date: Thu, 17 Dec 2015 18:15:18 -0500
Does a shift value longer than the word length make any sense anyway? On 12/17/15, Elizabeth Mattijsen <liz@dijkmat.nl> wrote: Show quoted text
>> On 17 Dec 2015, at 03:41, Zefram (via RT) <perl6-bugs-followup@perl.org> >> wrote: >> >> # New Ticket Created by Zefram >> # Please include the string: [perl #126942] >> # in the subject line of all future correspondence about this issue. >> # <URL: https://rt.perl.org/Ticket/Display.html?id=126942 > >> >> >> Long right shifts (longer than operand length) of negative integers >> should always produce -1, but in Rakudo after some length they stop >> doing that and switch to an incorrect output: >>
>>> -123 +> 8
>> -1
>>> -123 +> 31
>> -1
>>> -123 +> 32
>> 0
>>> -123 +> (1 +< 60)
>> 0 >> >> Some very long right shifts then run into [perl #126940] and [perl >> #126941], but those are separate issues.
> > $ 6 'say -123 +> 32' > -1 > > Temporarily fixed with 0e24208abfcc67b22a7f , test added with > 83057c9b8f97ed9b761f1 , should probably get a better fix at nqp level post > Christmas. Or not. > > > > Liz
From: Zefram <zefram [...] fysh.org>
To: Parrot Raiser via RT <perl6-bugs-followup [...] perl.org>
Subject: Re: [perl #126942] [BUG] large right-shift of negative loses sign
Date: Fri, 18 Dec 2015 03:56:05 +0000
Download (untitled) / with headers
text/plain 258b
Parrot Raiser via RT wrote: Show quoted text
>Does a shift value longer than the word length make any sense anyway?
With bignums, yes it does. Show quoted text
> -123 +< 200
-197653379443855803891661337357963000110230968235283518742069248 (Also, 32 isn't really my word length.) -zefram


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org