[Haskell-cafe] Re: How to decide if a number is an integer?
thomas.dubuisson at gmail.com
Tue Sep 29 02:16:54 EDT 2009
There are numerous ways to construct such a function. Hoogling
"(Fractional a, Integral b) => a -> b" brings up a host of functions
that would be of use here in combination with fromIntegral.
On Mon, Sep 28, 2009 at 11:11 PM, Magicloud Magiclouds
<magicloud.magiclouds at gmail.com> wrote:
> Here is an example:
> let l = fun num in
> if isIntegral l
> then l
> else 0
> How to do the isIntegral thing?
> On Tue, Sep 29, 2009 at 1:58 PM, Magicloud Magiclouds
> <magicloud.magiclouds at gmail.com> wrote:
>> In other weak-type language, `round i == i` would work. But in
>> haskell, what should I do? Thanks.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe