Probably silly floating comparison question

David Leadbeater at
Tue Aug 8 10:30:35 BST 2006 at wrote:
> I assume this is a rounding error with floating point values. How can I 
> make it do what I would expect it to do, which is make the first one 
> finish with 2.1?

while("$i" < 2)

Or: $i = new Math::BigFloat 0;

Math::BigFloat is probably more correct, but it's slow.


More information about the mailing list