Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thank you, fellow monks. While two of the above answers pointed out that int is exactly doing what its supposed to do, Rata followed the rather pragmatic approach to show how to actually use the int-function to get the expected result. Let me please try to hold awaken the interest in the practial approach, while peeking into the computer scientist material later.
In the following view on the problem, I try to round the number 1.255, and try to get the result 1.26. How would you perform this with the typical on-board means, to which undenyingly int() belongs to?
Please register, that the same code will do as expected when using "1.355" as value for $i. In reply to Re^2: How to use the int-function?
by Anonymous Monk
|
|