|
![](/i/fill.gif) |
On 1 Aug 2000 06:24:26 -0400, Warp <war### [at] tag povray org> wrote:
> Also | should have lower precedence than &, so if we have this:
>
>x-y | y-z & x+z
>
>it should be interpreted in this way:
>
>(x-y) | ((y-z) & (x+z))
>
> In this way it will be consistent with mathematics.
Call me stupid but I've never interpreted it this way. Instead, I'd
have read it thus:
x - ( (y?1:0) | (y?1:0) ) & (x?1:0)) + z
I don't know why, it's just that when I see logic operators I think
it's reasonable for them to expect boolean operands (promoted to
boolean if needed). And with that in mind, I expect multiplication to
have a higher precedence than addition, regardless of context.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usa net
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |