On Wed, Sep 7, 2011 at 16:25, Christopher Howard <christopher.howard@frigidcode.com> wrote:
Hi. I'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:

Nothing else is needed; you're just seeing the inevitable failure mode of floating point math (once you get into exponents that aren't integers, you can't escape it).  You may want to restrict printing precision.

(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, ....)

--
brandon s allbery                                      allbery.b@gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms