[Haskell-cafe] about integer and float operations
manlio_perillo at libero.it
Wed Feb 4 17:26:25 EST 2009
Max Rabkin ha scritto:
>> Here is an Haskell version:
>> On my system it takes 30 seconds.
> You're only dividing integers by integers to get Doubles.
> x /. y = fromIntegral x / fromIntegral y
> works just fine in this case.
No, this *does not works*.
I get Nan as result, since fromIntegral a, when a is out of range of a
double, returns Infinity.
Prelude> (fromIntegral (fac 777)) :: Double
CPython, does not try to convert to double, but, instead, to a scaled
More information about the Haskell-Cafe