Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Bad math

by moritz (Cardinal)
on Oct 31, 2011 at 15:08 UTC ( #934901=note: print w/ replies, xml ) Need Help??


in reply to Bad math

FWIW Perl 6 solves this problem by doing math in rational numbers by default:

$ perl6 -e 'say -53.80 + 46.70' -7.1

See also: What Every Computer Scientist Should Know About Floating-Point Arithmetic and rats and other pets.


Comment on Re: Bad math
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (15)
As of 2014-12-19 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (75 votes), past polls