Welcome to the world of floating point accuracy.
This little program typically ends within 100 iterations for me:
$ 6 'my int $a = 0; $a++ while (1..^(1+10e-15)).rand < 1+10e-15; say $a’
96
Either we dismiss this bug as being caused by lack of floating point accuracy,
or we build in something
Welcome to the world of floating point accuracy.
This little program typically ends within 100 iterations for me:
$ 6 'my int $a = 0; $a++ while (1..^(1+10e-15)).rand < 1+10e-15; say $a’
96
Either we dismiss this bug as being caused by lack of floating point accuracy,
or we build in something
# New Ticket Created by Itsuki Toyota
# Please include the string: [perl #129104]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/Ticket/Display.html?id=129104 >
See the following result
$ perl6 -e '(1..^(1+10e-15)).rand.say'
1.01
$