THX @6V6gt. While I was over getting my first vaccine shot I kept struggling with all these cases. I wrote this on an online C/C++ compiler. Handy for no Arduino attached.
# include <stdio.h>
if ( i_a = test() == 3 ) printf("\n ( = == ) is true, i_a is %d\n", i_a);
if ( i_a = (test() == 3)) printf("\n ( = ( == )) is true, i_a is %d\n", i_a);
if ((i_a = test()) == 3 ) printf("\n (( = ) == ) is true, i_a is %d\n", i_a);
All three expressions are true if test returns 3. All are false otherwise. The appearance at the bottom of the precedence chart of the assignment operators spun me around a bit but explains it of course. If you add the fact that the assignment statement returns the assigned value. Then add right-to-left and you can figure how things like
a = b = c;
I also use ( ) as mentioned earlier either to make sure I get what I want or as a courtesy to those who might read my code or even myself one day later. Although it would be nice to have a brain with sufficient number of cooperating cells that could just confidently omit any unnecessary parentheses.
( = == ) is true, i_a is 1
( = ( == )) is true, i_a is 1
(( = ) == ) is true, i_a is 3
...Program finished with exit code
Press ENTER to exit console.