The operator ==
returns a logic result either 0 or 1.
max1 == max2 == min1 == 1
will be interpreted as
( ( max1 == max2 ) == min1 ) == 1
When min1
is equal to 0 , max2
is equal to 1, max1
is equal to 0, the expression will be caculated as
( ( 0 == 1 ) == 0 ) == 1
( 0 == 0 ) == 1
1 == 1
1
and your loop will exit.