W liście z sob, 08-11-2003, godz. 22:41, Ben Escoto pisze:

> If I want to convert a Float to a Double, should I use
> 
> fromRational . toRational

realToFrac :: (Fractional b, Real a) => a -> b

It is actually defined as fromRational . toRational but GHC knows to
generate specialized code for particular types.

> And similarly, (fromInteger . toInteger) is the right way to convert
> the integral types?

fromIntegral :: (Num b, Integral a) => a -> b

-- 
   __("<         Marcin Kowalczyk
   \__/       [EMAIL PROTECTED]
    ^^     http://qrnik.knm.org.pl/~qrczak/

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to