D
Dan Jacobson
perldoc perlop says Testing for exact equality of floating-point equality or
inequality is not a good idea.
OK, perhaps add a new "squishy comparison operator" one could use so that even
this wouldn't overrun the last test at least on my computer:
$i=0; while($i<1){printf "$i\n"; $i+=.1};
$i=0; while($i<1){printf "%.19f\n",$i; $i+=.1}; #for details
The main frustration is that the < operator is much more sensitive to
tiny floating trailing digits than any of the printf defaults. I wish
there was a comparison operator "that was no more sensitive than printf".
inequality is not a good idea.
OK, perhaps add a new "squishy comparison operator" one could use so that even
this wouldn't overrun the last test at least on my computer:
$i=0; while($i<1){printf "$i\n"; $i+=.1};
$i=0; while($i<1){printf "%.19f\n",$i; $i+=.1}; #for details
The main frustration is that the < operator is much more sensitive to
tiny floating trailing digits than any of the printf defaults. I wish
there was a comparison operator "that was no more sensitive than printf".