<div dir="ltr">Ah - <a href="http://www.binaryconvert.com/result_double.html?decimal=048046051">http://www.binaryconvert.com/result_double.html?decimal=048046051</a> clarifies that<div><br></div><div>0.3 is represented internally as 2.99999999999999988897769753748E-1 , </div>

<div><br></div><div>so this is what inexact->exact converts to <span style="font-family:arial,sans-serif;font-size:13px">5404319552844595/</span><span style="font-family:arial,sans-serif;font-size:13px">18014398509481984 .</span></div>

<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I guess this makes a strong case for representing fixed-point numbers as integers.<br>

</font><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/24 Bakul Shah <span dir="ltr"><<a href="mailto:bakul@bitblocks.com" target="_blank">bakul@bitblocks.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, 24 Dec 2013 18:18:03 +0100 Mikael <<a href="mailto:mikael.rcv@gmail.com">mikael.rcv@gmail.com</a>> wrote:<br>


><br>
> Wait, just curious, what is the actual FP 64bit representation of 0.3 and<br>
> why does it turn out differently like this?<br>
><br>
> (and (exact->inexact 5404319552844595/18014398509481984) become .3 rather<br>
> than 0.299[something] or 0.3000[something])<br>
<br>
</div>This may give you a hint:<br>
<br>
$ bc<br>
obase=2<br>
5404319552844595<br>
10011001100110011001100110011001100110011001100110011<br>
18014398509481984<br>
1000000000000000000000000000000000000000000000000000000<br>
^D<br>
<br>
Or see<br>
<a href="http://en.wikipedia.org/wiki/Double-precision_floating-point_format" target="_blank">http://en.wikipedia.org/wiki/Double-precision_floating-point_format</a><br>
</blockquote></div><br></div>