Skip Menu |
Report information
Id: 127168
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: elizabeth <liz [at] dijkmat.nl>
masak <cmasak [at] gmail.com>
Cc:
AdminCc:

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



Subject: module on natives with negative values are wrong
To: rakudobug [...] perl.org
Date: Tue, 5 Jan 2016 12:45:42 +0100
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Download (untitled) / with headers
text/plain 283b
[12:40:37] <lizmat> m: my int $a = -10; say $a % 12 # wrong [12:40:38] <+camelia> rakudo-moar d1ff73: OUTPUT«-10␤» [12:40:46] <lizmat> m: my Int $a = -10; say $a % 12 # right [12:40:46] <+camelia> rakudo-moar d1ff73: OUTPUT«2␤» This is the source of RT #127161 Liz
Subject: [BUG] infix:<%> gives different result for negative rhs when the lhs is a native int in Rakudo
From: Carl Mäsak <cmasak [...] gmail.com>
To: rakudobug [...] perl.org
Date: Sat, 4 Jun 2016 12:10:38 +0200
Download (untitled) / with headers
text/plain 513b
<masak> this may sound outrageous, but I think I've just uncovered a bug in Rakudo <masak> m: my $x = 0; my $y = ($x - 1) % 8; say $y <camelia> rakudo-moar 48fe6a: OUTPUT«7␤» <masak> m: my int $x = 0; my $y = ($x - 1) % 8; say $y <camelia> rakudo-moar 48fe6a: OUTPUT«-1␤» <RabidGravy> well that's definitely "special" * masak submits rakudobug My expectation is for that second eval to also yield 7. In other words, the outcome of the modulo calculation shouldn't change just because $x is a native int.
To: "Carl Mäsak (via RT)" <perl6-bugs-followup [...] perl.org>
Subject: Re: [perl #128318] [BUG] infix:<%> gives different result for negative rhs when the lhs is a native int in Rakudo
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Date: Sat, 4 Jun 2016 22:15:51 +0200
Download (untitled) / with headers
text/plain 1019b
Show quoted text
> On 04 Jun 2016, at 12:11, Carl Mäsak (via RT) <perl6-bugs-followup@perl.org> wrote: > > # New Ticket Created by "Carl Mäsak" > # Please include the string: [perl #128318] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=128318 > > > > <masak> this may sound outrageous, but I think I've just uncovered a > bug in Rakudo > <masak> m: my $x = 0; my $y = ($x - 1) % 8; say $y > <camelia> rakudo-moar 48fe6a: OUTPUT«7␤» > <masak> m: my int $x = 0; my $y = ($x - 1) % 8; say $y > <camelia> rakudo-moar 48fe6a: OUTPUT«-1␤» > <RabidGravy> well that's definitely "special" > * masak submits rakudobug > > My expectation is for that second eval to also yield 7. In other > words, the outcome of the modulo calculation shouldn't change just > because $x is a native int.
$ perl6 -e 'use nqp; say nqp::mod_i(-1,8); say nqp::mod_I(-1,8,Int)’ -1 7 *if* this is a bug, it is a bug in the underlying nqp::mod_i implementation. Liz


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