[Haskell-cafe] How to decide if a number is an integer?

david48 dav.vire+haskell at gmail.com
Tue Sep 29 03:23:58 EDT 2009


On Tue, Sep 29, 2009 at 9:13 AM, Magicloud Magiclouds
<magicloud.magiclouds at gmail.com> wrote:
> The properFaction part is correct. So I posted the whole code, since
> "isInteger" should accept any reasonable incoming types. Well, in this
> one situation, it does not. And I cannot figure out why....

Floating point gives a lot of small errors, so maybe you shouldn't
test your fractional part to be = 0, but you should test it to be
close enough.


More information about the Haskell-Cafe mailing list