[Haskell-cafe] Type inference problem with division (/)

Tim Chevalier catamorphism at gmail.com
Wed Oct 31 13:55:48 EDT 2007

On 10/30/07, Felipe Lessa <felipe.lessa at gmail.com> wrote:
> On 10/30/07, Tim Chevalier <catamorphism at gmail.com> wrote:
> > ppos = pi/len2; pi and len2 are both Ints, so dividing them gives you
> > an Int. To convert to a Double, write ppos = fromIntegral (pi/len2).
> > (Type :t fromIntegral in ghci to see what else fromIntegral can be
> > used for.)
> You mean pi / fromIntegral len2, right?

You're right, that's what I meant. Sorry for the confusion.


Tim Chevalier * catamorphism.org * Often in error, never in doubt
"Unfortunately, there is no algorithm for making human relationships
work." -- Robin Williams

More information about the Haskell-Cafe mailing list