Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Perl6 discoveries — floating-point

by Grimy (Pilgrim)
on Oct 18, 2017 at 16:45 UTC ( #1201605=note: print w/replies, xml ) Need Help??


in reply to Perl6 discoveries — floating-point

More floating-point fun! .perl’s documentation states that its output “can usually be re-evaluated with EVAL to regenerate the object”, yet it uses the same imprecise representation as Str:
$ perl6 -MMONKEY-SEE-NO-EVAL -e 'my $a = 1e0 + 1e-15; say EVAL($a.perl +) == $a' False
Sets can be equal even if their elements aren’t:
$ perl6 -e 'my ($a, $b) = (1e0, 1e0 + 1e-15); say $a == $b; say set($a +) ~~ set($b); say $a (-) $b' False True set()

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1201605]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2023-10-04 20:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?