On 2012-08-31 15:17, Torsten wrote:

I found a strange behaviour for printf: If you do for example

printf "%d",29/100*100

you get 28. But with

printf "%d",29*100/100

it's 29. Seems to be related to rounding.
The perl version is 5.10.1 on debian.

There is nothing strange about it.

I think you are looking for the "%.0f" format.

See also 'perldoc -q decimal'.

--
Ruud


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to