
28 Jan
2007
28 Jan
'07
1:04 p.m.
Hi Dennis, (/) :: Fractional a => a -> a -> a div :: Integral a => a -> a -> a Basically, use / on Float/Double like things, and div on Int/Integer like things: If you do want to use double like things throughout, then using fromInteger around the place will help: floor (fromInteger j * (fromInteger n / fromInteger p2n)) This converts easy value from an Integer to a number thing, which will allow you to treat it like a Double/Float thing. If you are using Int (rather than Integer) you might need fromInteger (toInteger x) around the place. Thanks Neil