Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: int($x) gives strange result

by SFLEX (Chaplain)
on Aug 24, 2009 at 08:52 UTC ( [id://790772]=note: print w/replies, xml ) Need Help??


in reply to Re^2: int($x) gives strange result
in thread int($x) gives strange result

++moritz

I was playing with it to the thousandth and found about the same "BAD" result:
my $x = 1.159; print +(int($x*100.1))/100;

What did the Pro-Perl programmer say to the Perl noob?
You owe me some hair.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2025-06-14 17:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.