Octavian Râşniţă wrote:
I read it, and it doesn't sound very well:
"Rounding in financial applications can have serious implications, and
the rounding method used should be specified precisely. In these cases,
it probably pays not to trust whichever system rounding is being used by
Perl, but to instead implement the rounding function you need yourself."
It sounds like a limitation of perl because it makes the calculations at
a too low level and not correct the errors automaticly, and not a
limitation of computers in general, because PHP does it right, MS Excel
does it right, the Windows Calculator does it right, so it is not
something imposible to do automaticly.
Either the programs (not the languages) are doing their calculations in
cents, not dollars or they are rounding off at a higher level than Perl.
You just think they are not making errors because they're not telling
you what they're really doing.
If you want more accurate results, consider using bignum or bigrat (see
`perldoc bignum` and `perldoc bigrat`).
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
Regardless of how small the crowd is, there is always one in
it who has to find out the hard way that the laws of physics
applies to them too.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/