<div dir="ltr">On Wed, Sep 7, 2011 at 16:25, Christopher Howard <span dir="ltr">&lt;<a href="mailto:christopher.howard@frigidcode.com">christopher.howard@frigidcode.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi. I&#39;m working with simple functions involving rational exponents. I noticed that the (**) function seems to do okay with negative powers, but that something else is needed for rational exponents:<br></blockquote><div>
<br></div><div>Nothing else is needed; you&#39;re just seeing the inevitable failure mode of floating point math (once you get into exponents that aren&#39;t integers, you can&#39;t escape it).  You may want to restrict printing precision.</div>
<div><br></div><div>(No, this is not a bug.  No, there is no workaround that magically makes floating point behave the way new users think it should.  And no, this is absolutely *not* Haskell-specific; the same kind of question constantly comes up with C, C++, Perl, Java, PHP, ....)</div>
<div><br></div></div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br>
<br>
</div>