title: While condition only respected if I put while 1 and put an if and break with the same condition
body: <p>This is a part of a code that do a binary search in an array.</p>
  
  <pre><code>int arrayBinary_search(myarray[], key){
  
      int selector = 0;
      int low_limit = 0;
      int high_limit = SIZE;
      while (1){
          selector = (low_limit+high_limit)/2;
          printf("The selector is: %d\n", selector);
          if (myarray[selector] == key){
              return 1;
          }
          else {
              if (low_limit==selector || high_limit==selector)        // this is the condition
                  break;
              if (key &lt; myarray[selector])
                  high_limit = selector;
              else
                  low_limit = selector;
              printf("The high_limit is: %d\n", high_limit);
              printf("The low_limit is: %d\n", low_limit);
          }
  
      }
  
  }
  </code></pre>
  
  <p>The code works, but since is not recommended to put a while(1), I wanted to insert the condition <code>low_limit==selector || high_limit==selector</code> directly inside the while condition replacing that "1".</p>
  
  <p>So this should be:</p>
  
  <pre><code>int arrayBinary_search(myarray[], key){
  
      int selector = 0;
      int low_limit = 0;
      int high_limit = SIZE;
      while (!(low_limit==selector) &amp;&amp; !(high_limit==selector)){        // this is the condition implemented
          selector = (low_limit+high_limit)/2;
          printf("The selector is: %d\n", selector);
          if (myarray[selector] == key){
              return 1;
          }
          else {
              //if (low_limit==selector || high_limit==selector)
              //  break;
              if (key &lt; myarray[selector])
                  high_limit = selector;
              else
                  low_limit = selector;
              printf("The high_limit is: %d\n", high_limit);
              printf("The low_limit is: %d\n", low_limit);
          }
  
      }
  
  }
  </code></pre>
  
  <p>Because that condition should correspond to a NEGATED OR, which is two negated entries with AND.</p>
  
  <p>But, it doesn't work.</p>
  
  <p>Full code here: <a href="https://hastebin.com/cebaxicasu.cpp" rel="nofollow noreferrer">https://hastebin.com/cebaxicasu.cpp</a></p>