Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Small Perl 6 discoveries II, Rats

by afoken (Abbot)
on Sep 27, 2017 at 18:38 UTC ( #1200215=note: print w/replies, xml ) Need Help??


in reply to Re: Small Perl 6 discoveries II, Rats
in thread [Perl6] Small discoveries I, __DATA__

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re^2: Small Perl 6 discoveries II, Rats

Replies are listed 'Best First'.
Re^3: Small Perl 6 discoveries II, Rats
by Anonymous Monk on Sep 27, 2017 at 19:05 UTC
    So the question becomes, why does perl6 print all those wrong digits?
    > perl5 -E 'say 1.111111111111111111111' 1.11111111111111 > perl6 -e 'say 1.111111111111111111111' 1.11111111111111111604544
      Are you trolling or what?

      Here Perl6 is 1000 times more accurate, it's just not lying to you about being arbitrarily precise. You will notice that 1.11111111111111 is three digits shorter than 1.11111111111111111 !

      And also:
      holli@605 ~ $ perl -e 'say "oops" unless 0.1 + 0.2 == 0.3' oops holli@605 ~ $ perl6 -e 'say "yeah" if 0.1 + 0.2 == 0.3' yeah


      holli

      You can lead your users to water, but alas, you cannot drown them.
        > perl5 -E 'say 3e-1 - .3' 0 > perl6 -e 'say 3e-1 - .3' 5.55111512312578e-17
      why does perl6 print all those wrong digits?

      There is a well-hidden message in the "wrong" digits. Click here and follow the links.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        Why the difference?
        > 111111111111111111111/1000000000000000000000 0.111111111111111 > .111111111111111111111 0.11111111111111111604544

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1200215]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-10-22 05:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (272 votes). Check out past polls.

    Notices?