The problem is that both these values have the same .WHICH: $ 6 'say 1e0.WHICH; say (1e0 + 4e-15).WHICH' Num|1 Num|1
Nothing to do with Sets/Bags/Mixes/object hashes. > On 20 Oct 2017, at 17:02, Victor ADAM (via RT) <perl6-bugs-follo...@perl.org> > wrote: > > # New Ticket Created by Victor ADAM > # Please include the string: [perl #132330] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=132330 > > > > How to reproduce > ---------------- > > perl6 -e 'my ($a, $b) = set(1e0), set(1e0 + 4e-15); say $a ~~ $b, > $a.keys »≅« $b.keys' > > Expected behavior > ----------------- > > Prints `False(False)`. > > Actual behavior > --------------- > > Prints `True(False)`. > > This contradicts the documentation of the Setty ACCEPTS method: > “Returns True if $other and self contain all the same elements, and no > others.” The sets’ elements aren’t equal, or even approximately equal > (≅), and yet ACCEPTS (~~) returns `True`. > > Note that other set methods show similar behavior: `1e0 ⊖ (1e0 + > 4e-15)` is the empty set, `set(1e0, 1e0 + 4e-15)` only has one > element… > > Version information > ------------------- > > This is Rakudo version 2017.09 built on MoarVM version 2017.09.1 > implementing Perl 6.c.