 <p>The accepted answer ignores a very important aspect: extended precision floating point. The CPU may be doing calculations with a bit-size that exceeds your storage size. This will particularly be true if you use <code>float</code> but can also be true of <code>double</code> and other floating point types.</p> <p>To show the problem, the following <strong>assert may actually fail</strong> depending on how the compilation was done and how the chip behaves.</p> <pre><code> void function( float a ) { float b = a / 0.12345; assert( b == (a/0.12345) ); } </code></pre> <p>Now, in this reduced example it will likely always pass, but there are many cases where it will not. Simply look at <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323">GCC Bug 323</a> and look at how many defects are marked as duplicates. This extended precision causes problems for many people, and it may also cause problems for you.</p> <p>If you need a guarantee what you'll need to do is make a comparison function that takes two float parameters and guarantee that the function is never inlined (stored floats are not subject to extended precision). That is, you must ensure those floats are actually stored. There is also a GCC option called "store-float" I believe which forces storage, perhaps it can be used here on your individual function.</p>