warning: suggest parenthesis around assignment used as truth value

View: New views
1 Messages — Rating Filter:   Alert me  

warning: suggest parenthesis around assignment used as truth value

by G.. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I wonder why octave gives the following warning:

--------
octave:> warning("on", "all")
octave:> if (L = (1==1)), endif
warning: suggest parenthesis around assignment used as truth value
octave:>
--------

No warning if I use a 2nd pair of parenthesis:

--------
octave:> if ((L = (1==1))), endif
octave:>
--------

But isn't that last pair redundant?

G