Paul Underwood on Tue, 07 Dec 2021 20:46:42 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: logical operators -- documentation


I am sorry for using "associativity" wrongly.

I don't think it is "precedence"; Both || and && have the same "priority" in the documentation.

Here is another example:

for(n=1,9,if(n%2==1 || 1<0 && 3<2 || 3>2 ,print1(n" ")))
1 2 3 4 5 6 7 8 9

I think the documentation should read "right to left". It currently reads:

"Any sequence of logical or and and operations is evaluated from left to right, and aborted as soon as the final truth value is known."

I think the upshot is that || does appear to have great precedence than &&.
Best

Paul