It seems the binary operators '&' and '|' have the same priority so i assume they just evaluate from left to right, the shift operators('<<' and '>>') however seems to have higher priority than the previously mentioned operators and are thus evaluated first..
Pupil wrote:It seems the binary operators '&' and '|' have the same priority so i assume they just evaluate from left to right, the shift operators('<<' and '>>') however seems to have higher priority than the previously mentioned operators and are thus evaluated first..
But operators should NEVER be evaluated by position in expressions, but by type.
That's an ultra-BIG bug 8O
Pupil wrote:It seems the binary operators '&' and '|' have the same priority so i assume they just evaluate from left to right, the shift operators('<<' and '>>') however seems to have higher priority than the previously mentioned operators and are thus evaluated first..
But operators should NEVER be evaluated by position in expressions, but by type.
That's an ultra-BIG bug 8O
I think they behave in a logical way, i.e. as i expected them to evaluate, one thing i'm missing though, is a complete list in the manual of the priority order of the operators.
Saboteur wrote:But I think you have same problem in C. You must use parenthesis to avoid this. Or what do you want to evaluate first?
Same problem in C ?? Mmm... I'm not sure. If you say that...I didn't know it. However, i think AND operator should have priority over OR operator for logical expressions, and at least in the old Borland C++ there is like that.
Pupil wrote:one thing i'm missing though, is a complete list in the manual of the priority order of the operators.
Yes! Me too.
Last edited by Psychophanta on Sun Jan 23, 2005 9:54 pm, edited 1 time in total.