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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to