Rational sequence

2002-10-22 Thread Ferenc Wagner
With GHC-5.02.2, I do $ ghci Prelude :m Ratio Ratio [1%2..10%2] [1 % 2,3 % 2,5 % 2,7 % 2,9 % 2,11 % 2] The question is, why is there 11%2 at the end of the list? It's inconsistent with the (good) rules for Integer, since Ratio [1,3..10] [1,3,5,7,9] Is this intentional?

Re: Rational sequence

2002-10-22 Thread Alastair Reid
Ferenc Wagner [EMAIL PROTECTED] writes: $ ghci Prelude :m Ratio Ratio [1%2..10%2] [1 % 2,3 % 2,5 % 2,7 % 2,9 % 2,11 % 2] H, the CVS copy of Hugs seems to suffer from a different problem: Prelude [0.5,1.5..5.5]::[Rational] [0 % 1,1 % 1,2 % 1,3 % 1,4 % 1,5 % 1] I'm expecting to see: [1 %

Re: Rational sequence

2002-10-22 Thread Jerzy Karczmarczuk
Alastair Reid: Ferenc Wagner [EMAIL PROTECTED] writes: H, the CVS copy of Hugs seems to suffer from a different problem: Prelude [0.5,1.5..5.5]::[Rational] [0 % 1,1 % 1,2 % 1,3 % 1,4 % 1,5 % 1] I'm expecting to see: [1 % 2,3 % 2,5 % 2,7 % 2,9 % 2,11 % 2] Rationals in Hugs were

RE: Rational sequence

2002-10-22 Thread Simon Peyton-Jones
] | Subject: Rational sequence | | With GHC-5.02.2, I do | | $ ghci | Prelude :m Ratio | Ratio [1%2..10%2] | [1 % 2,3 % 2,5 % 2,7 % 2,9 % 2,11 % 2] | | The question is, why is there 11%2 at the end of the list? | It's inconsistent with the (good) rules for Integer, since | | Ratio [1,3..10] | [1,3,5,7,9

Re: Rational sequence

2002-10-22 Thread Ferenc Wagner
Simon Peyton-Jones [EMAIL PROTECTED] writes: The Report says that the Enum instance for Ratio uses the same rule as for Float/Double, Now I can see that the revised Report contains more about this than the one on haskell.org. But I still can't see the statement you cited above. Where should

Re: Rational sequence

2002-10-22 Thread Alastair Reid
Jerzy Karczmarczuk [EMAIL PROTECTED] writes: Rationals in Hugs were always a bit obscure. What do you think, what is the Rational form of 2.3 ? (GHCi says 23/10). The answer is: 2589569785738035 % 1125899906842624 (Old Hugs, Feb. 2001) I'm afraid the new release won't fix this. Once

Re: Rational sequence

2002-10-22 Thread Frank Atanassow
Jerzy Karczmarczuk wrote (on 22-10-02 13:05 +0200): What do you think, what is the Rational form of 2.3 ? (GHCi says 23/10). The answer is: 2589569785738035 % 1125899906842624 Er, why? Because 2.3 is not representable using a double precision float or something? -- Frank

Re: Rational sequence

2002-10-22 Thread Frank Atanassow
Frank Atanassow wrote (on 22-10-02 15:08 +0200): Jerzy Karczmarczuk wrote (on 22-10-02 13:05 +0200): What do you think, what is the Rational form of 2.3 ? (GHCi says 23/10). The answer is: 2589569785738035 % 1125899906842624 Er, why? Because 2.3 is not representable using a