"numerator" and "denominator"

Iain McNaughton im@t956379207.demon.co.uk
Tue, 7 Aug 2001 10:45:47 +0100


Hi !

In the Haskell 98 Library Report it says:
"The functions numerator and denominator extract the components of a
ratio; these are in reduced form with a positive denominator".

However, when I try to use these functions on WinHugs, I get results
like:
        numerator 1.3 = 5452595
        denominator 1.3 = 4194304

This strikes me as strange, as what I was expecting was:
        numerator 1.3 = 13
        denominator 1.3 = 10

What's particularly strange is that Hugs' answers aren't even of the
form ( 13n, 10n ), and 5452595/4194304 is not equal to 1.3 in real life
( though it apparently is in Hugs ! ).

I'd appreciate any comments you may have on this, as it kind of looks
like a bug to me ( or am I just being dumb ! ).

Thanks for your help with this.

Sincerely,

Iain McNaughton.


-- 
Iain McNaughton