Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: shocking imprecision

by Ovid (Cardinal)
on Oct 18, 2011 at 05:32 UTC ( #932067=note: print w/ replies, xml ) Need Help??


in reply to Re: shocking imprecision
in thread shocking imprecision

Actually, that's why sprintf and printf are recommended:

perl -E 'say int(-1.2 + .5); printf("%d\n",-1.2)'

One of those is going to send the Monk back here with more questions :)


Comment on Re^2: shocking imprecision
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2014-12-19 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (75 votes), past polls