[Israel.pm] perl arithmetic

Pinkhas Nisanov nisanov at netvision.net.il
Sun Apr 18 08:05:32 PDT 2004


On Sun, 2004-04-18 at 17:51, Yuval Kogman wrote:

> What I meant was always work with the highest percision you can, using
> integer arithmetic, never converting to float, except for formatting
> purposes.

I do not convert it to float, I get it float from input.
It's actually product price.

> 
> BTW:
> [eris:~] nothingmuch% perl -e 'print int 100*4.56, "\n";'
> 456

sorry guys, but on my perl 5.8.1:
perl -e 'print int 100*4.56, "\n";'

gives me:
455

regards
Pinkhas Nisanov




More information about the Perl mailing list