<p>Welcome to IEEE floating point math!</p>
<p>Wikipedia has a good article on the specification. If you want exact fractional numbers for your own purposes, there are a number of ways around the limits of floats.</p>
<p>Rational will represent numbers internally as fractions, and still allow you to use the same syntax as above. The result will be &quot;3 % 10&quot;, which you read as the fraction 3 / 10.</p>
<p>If you also want irrational numbers, things get tricky. CReal will do it, but has some limitations.</p>
<div class="gmail_quote">On Jan 16, 2013 8:26 AM, &quot;ivan dragolov&quot; &lt;<a href="mailto:ivan@dragolov.net">ivan@dragolov.net</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br clear="all">9.3 - (2 * 4.5) =&gt; 0.3000000000000007<br><br>I expected 0.3<br><br>?<br><br>-- <br><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">Иван Драголов</span></div><div>
<span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"><a href="http://dragolov.net/" style="color:rgb(42,93,176)" target="_blank">dragolov.net</a><br>
<br>GSM: 0888 63 19 46<br>GSM за SMS: 0878 82 83 93  <br><a href="http://facebook.com/ivan.dragolov" style="color:rgb(42,93,176)" target="_blank">facebook.com/ivan.dragolov</a></span></div><div><a href="http://twitter.com/dragolov" target="_blank">twitter.com/dragolov</a></div>


<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div>