title: How to correctly and standardly compare floats?
body: <p>Every time I start a new project and when I need to compare some float or double variables I write the code like this one:</p>
  
  <pre><code>if (fabs(prev.min[i] - cur-&gt;min[i]) &lt; 0.000001 &amp;&amp;
      fabs(prev.max[i] - cur-&gt;max[i]) &lt; 0.000001) {
          continue;
  }
  </code></pre>
  
  <p>Then I want to get rid of these magic variables 0.000001(and 0.00000000001 for double) and fabs, so I write an inline function and some defines:</p>
  
  <pre><code>#define FLOAT_TOL 0.000001
  </code></pre>
  
  <p>So I wonder if there is any standard way of doing this? May be some standard header file?
  It would be also nice to have float and double limits(min and max values)</p>