
4 Feb
2009
4 Feb
'09
7:22 p.m.
On Thu, 2009-02-05 at 01:10 +0100, Manlio Perillo wrote:
Yitzchak Gale ha scritto:
In our case, the Python division first does a quick estimate of the sizes of the two integers, and just returns zero if it sees that there will be underflow on conversion to double. So I made the following rough change to the Haskell:
-- An exact division (/.) :: Integer -> Integer -> Double x /. y | y `div` x > 5*10^323 = 0 | otherwise = fromRational $ toRational x / toRational y
Right, but I would like to see a proper implemented function for exact integer division in GHC.
(%) *is* a proper function for exact integer division. But you'll find plenty of Haskellers to balk at calling anything that returns a Double `proper'. jcc