title: Understanding for the use of the & Bitwise Operator
body: <p>I have been analyzing a code and trying to understanding each part of the algorithm.
  I came across this part where the bitwise and operator was used</p>
  
  <pre><code>if (qpd &gt;= 0) qpd += qpd&amp;1;
  else qpd -= qpd&amp;1;
  </code></pre>
  
  <p>From what I understand, the algorithm wants to use the 1 as a mask for the variable qpd but since the number is just 1, there's not much sense in doing an operation that virtually does not make any changes. Please enlighten me here since I'm lost.</p>
  
  <p>The foor loop, which gets the magnitude and frequency of the data from an array, that uses the bitwise operator is as follows:</p>
  
  <pre><code>/* this is the analysis step */
              for (k = 0; k &lt;= fftFrameSize2; k++) {
  
                  /* de-interlace FFT buffer */
                  real = gFFTworksp[2*k];
                  imag = gFFTworksp[2*k+1];
  
                  /* compute magnitude and phase */
                  magn = 2.*sqrt(real*real + imag*imag);
                  phase = atan2(imag,real);
  
                  /* compute phase difference */
                  tmp = phase - gLastPhase[k];
                  gLastPhase[k] = phase;
  
                  /* subtract expected phase difference */
                  tmp -= (double)k*expct;
  
                  /* map delta phase into +/- Pi interval */
                  qpd = tmp/M_PI;
                  if (qpd &gt;= 0) qpd += qpd&amp;1;
                  else qpd -= qpd&amp;1;
                  tmp -= M_PI*(double)qpd;
  
                  /* get deviation from bin frequency from the +/- Pi interval */
                  tmp = osamp*tmp/(2.*M_PI);
  
                  /* compute the k-th partials' true frequency */
                  tmp = (double)k*freqPerBin + tmp*freqPerBin;
  
                  /* store magnitude and true frequency in analysis arrays */
                  gAnaMagn[k] = magn;
                  gAnaFreq[k] = tmp;
  
              }
  </code></pre>