title: Why fmod(1.0,0.1) == .1?
body: <p>I experienced this phenomenon in Python first, but it turned out that it is the common answer, for example MS Excel gives this. Wolfram Alpha gives an interesting schizoid answer, where it states that the rational approximation of zero is 1/5. ( <a href="http://www.wolframalpha.com/input/?i=1.0+mod+.1" rel="nofollow">1.0 mod 0.1</a> )</p>
  
  <p>On the other hand, if I implement the definition by hand it gives me the 'right' answer (0).</p>
  
  <pre><code>def myFmod(a,n):
      return a - floor(a/n) * n
  </code></pre>
  
  <p>What is going on here. Do I miss something?</p>