title: (do while) measuring until the value doesnt change anymore
body: <p>I'm trying to measure a value and use it, when it is stable. I thought I could use a do while loop and use a second value to compare it with the main value. Here is my code:</p>
  <pre><code>          do {
              mess.Acal[mess.j][0] = analoginput();
              HAL_Delay(100);
              mess.x2 = analoginput();
            } while (mess.x2 - mess.Acal[mess.j][0] &gt;= 0.000001 &amp;&amp; mess.Acal[mess.j][0] -mess.x2 &gt;=0.000001 );
                                                                                                                                                  
      }
  </code></pre>
  <p>x2 and Acal are both doubles.
  So basically I measure the first value (e.g 1.256301222V). Then with HAL_delay, i let the program wait 100ms and redo the measurement on x2 (e.g 1.256268049V). For the while i thought i can subtrahate both and it breaks out if the difference is under 0.000001V. Somehow the loop breaks, even though the Difference is: 0.000033182V, which is &gt; 0.000001V. Is it not possible to subtrahate such small values? Or does while() not work like this?
  Thanks for the help.</p>