Perhaps someone can point me in the right direction to where I can find out what is going wrong.
if I take the log of some integer number with a known integer return, say 8, I think that there is an internal round off error. Here is why.
- $return = log( 8, 2); // should be 3, right?
- $floor = floor( $return ); shouldn't this still be 3?
now I'll print the two values, and here's what I'm getting:
print "<br>return = '$return'<br>floor = '$floor'";
output: return = '3'
output: floor = '2'
now I'll change the code in step 1:
1a. $return = log( 8.000000001, 2 )
the final output is now
output: return = '3'
output: floor = '3'
Is there something that I should know about? I'm using PHP 4.3.8
Thanks for any help or suggestions.