Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 contemplating the Monastery: (9)
As of 2014-09-22 21:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (202 votes), past polls