From:             [EMAIL PROTECTED]
Operating system: Linux (Debian sid)
PHP version:      4.1.0
PHP Bug Type:     Math related
Bug description:  pow and floor misbehavior

Executing this code:

print((      floor(7)  ==       floor(7.1) ) . "<BR>");
print((pow(2,floor(7)) == pow(2,floor(7.1))) . "<BR>");

outputs

1<BR><BR>

So, if floor(7) is equal to floor(7.1) how can pow(2,x) from both numbers
be different?

PHP 4.0.3pl1 gives the correct output 1<BR>1<BR>

Using the === to compare both non of the expressions is true, so i think
floor and pow return int if the input is a integer, but the documentation
says they always returns float. If i use 7.0 instead if 7 the output is
correct and both expressions are equal.

-- 
Edit bug report at: http://bugs.php.net/?id=14646&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to