Skip Menu |
Report information
Id: 128819
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)



Date: Tue, 2 Aug 2016 18:44:30 +0100
Subject: [BUG] Num.WHICH doesn't discriminate enough
To: rakudobug [...] perl.org
From: Zefram <zefram [...] fysh.org>
Download (untitled) / with headers
text/plain 506b
Show quoted text
> my $a = 1180591620717411303424e0
1.18059162071741e+21 Show quoted text
> my $b = 1180591620717409992704e0
1.18059162071741e+21 Show quoted text
> $a.Int
1180591620717411303424 Show quoted text
> $b.Int
1180591620717409992704 Show quoted text
> $a == $b
False Show quoted text
> $a === $b
False Show quoted text
> $a.WHICH
Num|1.18059162071741e+21 Show quoted text
> $b.WHICH
Num|1.18059162071741e+21 Show quoted text
> $a.WHICH eq $b.WHICH
True These are distinct Num values, as seen by .Int, ==, and ===. But .WHICH is erroneously saying that they're the same. .WHICH should show distinct identities for these distinct values. -zefram
Date: Fri, 19 Aug 2016 22:08:55 +0100
From: Zefram <zefram [...] fysh.org>
To: perl6 via RT <perl6-bugs-followup [...] perl.org>
Subject: Re: [perl #128819] [BUG] Num.WHICH doesn't discriminate enough
Download (untitled) / with headers
text/plain 138b
Additional: the same problem arises with Complex.WHICH, in cases where the real or imaginary parts suffer this problem as Nums. -zefram
RT-Send-CC: perl6-compiler [...] perl.org
On Tue, 02 Aug 2016 10:44:50 -0700, zefram@fysh.org wrote: Show quoted text
> > my $a = 1180591620717411303424e0
> 1.18059162071741e+21
> > my $b = 1180591620717409992704e0
> 1.18059162071741e+21
> > $a.Int
> 1180591620717411303424
> > $b.Int
> 1180591620717409992704
> > $a == $b
> False
> > $a === $b
> False
> > $a.WHICH
> Num|1.18059162071741e+21
> > $b.WHICH
> Num|1.18059162071741e+21
> > $a.WHICH eq $b.WHICH
> True > > These are distinct Num values, as seen by .Int, ==, and ===. But .WHICH > is erroneously saying that they're the same. .WHICH should show distinct > identities for these distinct values. > > -zefram
Thank you for the report. This is now fixed. Fix: https://github.com/MoarVM/MoarVM/commit/067c0594103a025 https://github.com/MoarVM/MoarVM/commit/8841c4241b4faa8 https://github.com/MoarVM/MoarVM/commit/af2eb8a7f7d4344 https://github.com/MoarVM/MoarVM/commit/4d3fc2818d0032b https://github.com/rakudo/rakudo/commit/8422d7b4e23678b https://github.com/rakudo/rakudo/commit/a2a2a745c4242d1 Test: https://github.com/perl6/roast/commit/3f0174e45563d641e


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