Prev: FAQ 4.8 How do I perform an operation on a series of integers?
Next: FAQ 5.27 How do I set a file's timestamp in perl?
From: Ilya Zakharevich on 25 May 2010 01:23 On 2010-05-24, Peter J. Holzer <hjp-usenet2(a)hjp.at> wrote: > my $x1 = 18014398509481728.000000; # exact FP value > my $x2 = 18014398509481729; # exact 64 bit int value > if ($x1 >= $x2) { > print "surprise!\n"; > } Thinking about it more, it is not a "surprise", but just a plain bug. It is trivial to write down a macro ncmp_IV_NV(iv,nv) which would do the "correct thing" in both cases (powerful- and braindamaged-NVs). So the fact that Perl does not use such a construct is a bug. Hope this helps, Ilya |