Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 avoiding work at the Monastery: (6)
As of 2024-06-15 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.