Floats and Doubles

Simon Marlow simonmar@microsoft.com
Wed, 13 Nov 2002 14:41:53 -0000


> But this brings up a strange thing in GHCi. Suppose I load=20
> the following module into GHCi:
>=20
> \begin{code}
> module Foo where
>=20
> kalle =3D (fromRational ((toRational 4) - ( toRational 5.2 )))
>=20
> default (Rational)
> \end{code}
>=20
> What happens is the following:
>=20
> Prelude> :l Foo.hs
> Compiling Foo              ( Foo.hs, interpreted )
> Ok, modules loaded: Foo.
> *Foo> kalle
> (-6) % 5
> *Foo> (fromRational ((toRational 4) - ( toRational 5.2 )))
> -1.2000000000000002
>=20
> It seems like GHCi doesn't care about the default directive=20
> on the promt.

This is a known bug:

http://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D431362&group=
_id
=3D8032&atid=3D108032

Cheers,
	Simon