in reply to Integer detection concept
prints 17.00000000000002 on my perl 5.005_003 on an x86. Is that an integer? merlin's comment shows how to see if a number is a "good" integer, but if you are using this in some mathematics, you might check for some fudge as it is fairly easy to get a non-integer that "should be" an integer.$x = 17; for $i (1..10){ $x = sqrt($x); } for $i (1..10){ $x *= $x; } print $x;
You probably knew that, but it might not be obvious to everyone...
--traveler
|
|---|