[Haskell-cafe] Where would I find fromInt?

2007-09-09 Thread PR Stanley
Hi Where would I find the fromInt function, please? Better still, would anyone know how to write a func for converting int to float and vice versa? Thanks, Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/list

Re: [Haskell-cafe] Where would I find fromInt?

2007-09-09 Thread Tom Harper
Hi Paul -- The function you want is called fromIntegral, and works for all Integral types. Using it, you can add a type signature to specify what you want to change the number to (Float, Double, other Integral type, etc. Example: > fromIntegral (4 :: Int) :: Double 4.0 Hope this helps! -- Tom

Re: [Haskell-cafe] Where would I find fromInt?

2007-09-09 Thread Albert Y. C. Lai
To the tune of the theme song of Ghostbusters: You've got an Int But you want Double Who do you call? "fromIntegral!" (The inverse conversion requires you to think about rounding first.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www

Re: [Haskell-cafe] Where would I find fromInt?

2007-09-10 Thread Andrew Coppin
Albert Y. C. Lai wrote: To the tune of the theme song of Ghostbusters: You've got an Int But you want Double Who do you call? "fromIntegral!" Let it never, *never* be said that math nerds don't have humour... ___ Haskell-Cafe mailing list Haskell-Ca