title: How to throw an exception on `float==float` operation?
body: <p>Imagine that an <a href="http://en.wikipedia.org/wiki/Floating-point#Accuracy_problems" rel="nofollow noreferrer">inexperienced</a> <a href="https://stackoverflow.com/q/588004/1176601">programmer</a> tries to compare 2 floats for equivalence:</p>
  
  <pre><code>a = 0.01
  b = 0.1 ** 2
  print(a == b)
  </code></pre>
  
  <p>Is there any language that would throw an exception on such foolishness? Or a way to override the default behaviour in python and/or javascript?</p>
  
  <p>If not, what is the reason behind language design decision to allow the operation?
  <hr>
  EDIT: Looks like I've been accused of suggesting to make comparisons of floats impossible. I have nothing against <code>a &lt; b</code> or <code>float_eq(a, b)</code>. It's just that most people have very different intuition about what <code>==</code>, <code>!=</code>, <code>&gt;=</code> and <code>&lt;=</code> operators are supposed to do from what they actually do with float numbers. There are various precedents in language design to prevent some of the dumber mistakes people tend to make, like disallowing <code>if(a=b)</code> in python or <code>use strict</code> in perl.</p>