Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Why does perl math suck?

by tilly (Archbishop)
on Jan 29, 2011 at 15:39 UTC ( [id://885026]=note: print w/replies, xml ) Need Help??


in reply to Why does perl math suck?

perl -le 'print 5056.45 + 10112.92 eq 15169.37 ? "as expected" : "perl math sucks!"' works as expected. The reason is that Perl uses more digits in floating point calculations than it stringifies, so stringification rounds off to the expected number. (I didn't invent this trick.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-20 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found