<div dir="ltr">On Fri, Sep 20, 2013 at 12:17 PM, damodar kulkarni <span dir="ltr">&lt;<a href="mailto:kdamodar2000@gmail.com" target="_blank">kdamodar2000@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Ok, let&#39;s say it is the effect of truncation. But then how do you explain this?<br><br><span style="font-family:courier new,monospace">Prelude&gt; sqrt 10.0 == 3.1622776601683795<br>
True<br>Prelude&gt; sqrt 10.0 == 3.1622776601683796<br>

True<br></span></div></div></div></blockquote><div><br></div><div>Because there&#39;s no reliable difference there. The truncation is in bits (machine&#39;s binary representation) NOT decimal digits. A difference of 1 in the final digit is probably within a bit that gets truncated.</div>
<div><br></div><div>I suggest you study IEEE floating point a bit. Also, study why computers do not generally store anything like full precision for real numbers. (Hint: you *cannot* store random real numbers in finite space. Only rationals are guaranteed to be storable in their full precision; irrationals require infinite space, unless you have a very clever representation that can store in terms of some operation like sin(x) or ln(x).)</div>
<div><br></div></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div>
<div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div>