On 05/02/11 04:34, Jeff Hobbs wrote: > This is due to not all floating point numbers being exactly > representable in IEEE floating point math. This is a problem across > machines and languages. More info at: > > http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems > > This is also why it can be dangerous to do floating point increments in > loops. Generally at the language level, it will depend on where the > rounding kicks in, which you can adjust for printing purposes, but the > math is only as good as the underlying hardware handles (which is why > integer-based math for decimal values in some situations is required).
For precision math, try the Math::BigFloat library. Very handy. _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs