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

Magicloud Magiclouds magicloud.magiclouds at gmail.com
Tue Sep 29 02:35:08 EDT 2009


It never matches to (_, 0.0)....
I mean
case properFraction l of
  (_, 0) -> l
  _ -> 0 -- always goes here.

On Tue, Sep 29, 2009 at 2:18 PM, Jimmy Hartzell <jim at shareyourgifts.net> wrote:
> Use properFraction:
> http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v%3AproperFraction
>
>> Hi,
>>   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
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
>
>



-- 
竹密岂妨流水过
山高哪阻野云飞


More information about the Haskell-Cafe mailing list