Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Num.WHICH doesn't discriminate enough #5520

Closed
p6rt opened this issue Aug 2, 2016 · 5 comments
Closed

Num.WHICH doesn't discriminate enough #5520

p6rt opened this issue Aug 2, 2016 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 2, 2016

Migrated from rt.perl.org#128819 (status was 'resolved')

Searchable as RT128819$

@p6rt
Copy link
Author

p6rt commented Aug 2, 2016

From zefram@fysh.org

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

@p6rt
Copy link
Author

p6rt commented Aug 19, 2016

From zefram@fysh.org

Additional​: the same problem arises with Complex.WHICH, in cases where
the real or imaginary parts suffer this problem as Nums.

-zefram

@p6rt
Copy link
Author

p6rt commented Apr 13, 2018

From @zoffixznet

On Tue, 02 Aug 2016 10​:44​:50 -0700, zefram@​fysh.org wrote​:

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​: MoarVM/MoarVM@067c0594103a025
  MoarVM/MoarVM@8841c4241b4faa8
  MoarVM/MoarVM@af2eb8a7f7d4344
  MoarVM/MoarVM@4d3fc2818d0032b
  rakudo/rakudo@8422d7b4e23678b
  rakudo/rakudo@a2a2a745c4242d1
Test​: Raku/roast@3f0174e45563d641e

@p6rt
Copy link
Author

p6rt commented Apr 13, 2018

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 13, 2018

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Apr 13, 2018
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant