title: Modern practice to compare double/float for equality in modern C++
body: <pre><code>if (std::abs(double1 - double2) &lt; std::numeric_limits&lt;double&gt;::epsilon())
    std::cout&lt;&lt;&quot;Equal&quot;;
  else
    std::cout&lt;&lt;&quot;Not equal&quot;;
  </code></pre>
  <p>Is this code with modern C++11/14/17/21 is still the way we should compare float and doubles, or now it's ok just to write</p>
  <pre><code>if (double1 == double2)
  </code></pre>
  <p>And compiler will handle the epsilon issue for us?</p>
  <p>BTW: is it better to write &lt; or &lt;= when checking against epsilon?</p>