Re: Re: #41401 [Opn->Bgs]: Order of Operations error on divide by negative
| From: | Richard Lynch | Date: | Thu, 17 May 2007 18:32:12 +0000 |
| Subject: | Re: Re: #41401 [Opn->Bgs]: Order of Operations error on divide by negative | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-29497@lists.php.net to get a copy of this message | ||
On Wed, May 16, 2007 9:08 am, Brian Moon wrote:
> According to my memory of Please My Dear Aunt Sally these should be:
My memory has "My Dear" in equal priority, left to right...
This documentation would seem to bear that out:
http://us.php.net/manual/en/language.operators.php#language.operators.precedence
> -1/2*5 = -.1
> 1/-2*5 = -.1
> 1/2*-5 = -.1
Those are most definately all wrong. :-)
> So, that is bad if PHP answers that way. Someone please correct me if
> my memory is wrong. Is there some rule that negative values should be
> done first before positive values?
Yes.
The unary "-" operator buried in the third line that table is "that
rule."
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?