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 Harper
[EMAIL PROTECTED]
+1 949 235 0185
Public Key: http://aftereternity.co.uk/rth.asc


On 9/9/07, PR Stanley <[EMAIL PROTECTED]> wrote:
> 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/listinfo/haskell-cafe
>


-- 
Tom Harper
[EMAIL PROTECTED]
+1 949 235 0185
Public Key: http://aftereternity.co.uk/rth.asc
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to