
23 Sep
2005
23 Sep
'05
3:10 p.m.
Thanks for this: All I have to do now is fix the fact that my maths is stupidly screwed! On Fri, Sep 23, 2005 at 02:23:10PM -0400, J. Garrett Morris wrote:
Haskell doesn't do automatic numeric conversion for you - you need to use fromIntegral to go from an integral type (like 2) to a floating point type (as you'd need for division) and you can use round or trunc to go the other direction. There's similarly a fromRational function to convert from rational numbers to just about anything else you'd need. A couple of applications of those functions - probably mainly around your divisions - should fix things up.
/g