Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 perusing the Monastery: (8)
As of 2014-08-23 16:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (174 votes), past polls