On 16/05/07, Uwe Schindler <[EMAIL PROTECTED]> wrote:
> Should all these three examples give the same result?
>
> $ php -r 'var_dump(-1/2*5, 1/-2*5, 1/2*-5);'
> float(-2.5)
> float(-0.1)
> float(-2.5)
They should all give -2.5! But I think "normal programmers" will use braces
in such situations...
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
If you use variables, then this works fine ...
php -r "$a = 1; $b = -2; $c = 5; var_dump($a/$b*$c);"
float(-2.5)
--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php