Hi.
I'm working on a little script that will work out if a number is prime or not. However, i'm being hampered by the fact that PHP doesn't seem to be setting the correct variable types to any numbers it generates.
For example, i set 3 (which is a prime) and php recognises it as a integer. Then i use sqrt(3) and store the result as $root. $root is a double, which is fine since you can't divide three evenly.
All this is fine and good, but when i use 4, it understands that 4 is an integer, but when i get the square root as $root it thinks $root is a double.
I've used number_format and added about 70 decimal places to check if the 2 returned by sqrt was a float of some sort, but no, it's a whole number, so why is it being returned as a double?
I'm using PHP 4.2.3 on WinXP.