RE: [PHP-DEV] Re: #41401 [Opn->Bgs]: Order of Operations error on divide by negative
| From: | Uwe Schindler | Date: | Wed, 16 May 2007 14:05:08 +0000 |
| Subject: | RE: [PHP-DEV] Re: #41401 [Opn->Bgs]: Order of Operations error on divide by negative | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-29463@lists.php.net to get a copy of this message | ||
> 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...