Hugs Humor
Jerzy Karczmarczuk
karczma@info.unicaen.fr
Mon, 07 Jul 2003 13:40:17 +0200
Ross Paterson wrote:
> In the case of 0.1::Rational, it shouldn't be using floating point.
> The Report says this means fromRational (1%10), i.e. 1%10.
Aha. Now I have a little chance to die less na=EFve. All my conversion
proposals are simply out of place, since there should be nothing
to convert. And I understand the reluctance of J=F3n to accept the
numerical types as belonging to the language...
=2E.. and I begin once again to appreciate the Scheme idea of having
the distinction between exact and inexact numbers.
Of course, you are right reminding that when floats are engaged there
is fuzziness in the conversion:
> (e.g.: which approximant in the series should be chosen?)
but I believe (still na=EFvely??) that those socio-psycho-pragmatisms
which played some role in the definition of the language should
be better tuned. If I were to write
pi =3D 3.1415926536 :: Rational
I suppose that I would like to see rather 355/113 or something close,
than 3926990817/1250000000 or similar. GHCI doesn't make me happier than
Hugs: 221069929751607/70368744177664. Thus, perhaps one day we might
think about parametrizing the 'conversion' of *explicit* decimal numbers,=
and -- as some other language permit -- make it possible and practical
to use any other base different from 10. What do you think?
Such parametrization (perhaps with some global default) would also help
the user who permits himself to write x =3D 1.875987 :: Rational to
assess the error introduced by the representation conversion.
Jerzy Karczmarczuk