infinite (fractional) precision

2002-10-10 Thread Ketil Z. Malde
Hi I was just browsing around on comp.arch a bit, and there was this discussion about various ways to represent non-integer numeric values. It seems one could easily (I'll get back to that in a moment) calculate the fractional part of numbers lazily, generating the needed precision, and nothin

Re: infinite (fractional) precision

2002-10-10 Thread Nick Name
On 10 Oct 2002 10:29:24 +0200 [EMAIL PROTECTED] (Ketil Z. Malde) wrote: > I realize it's probably far from trivial, e.g. comparing two equal > numbers could easily not terminate, you should compare into a given precision V. -- Fedeli alla linea, anche quando non c'è Quando l'imperatore è mal

Re: infinite (fractional) precision

2002-10-10 Thread Jerzy Karczmarczuk
Ketil Z. Malde wrote: > It seems one could easily (I'll get back to that in a moment) > calculate the fractional part of numbers lazily, generating the needed > precision, and nothing more. Does any such implementation exist in > Haskell? > > I realize it's probably far from trivial, e.g. compa

Re: infinite (fractional) precision

2002-10-10 Thread Ashley Yakeley
At 2002-10-10 01:29, Ketil Z. Malde wrote: >I realize it's probably far from trivial, e.g. comparing two equal >numbers could easily not terminate, and memory exhaustion would >probably arise in many other cases. I considered doing something very like this for real (computable) numbers, but bec

Re: infinite (fractional) precision

2002-10-10 Thread Jerzy Karczmarczuk
Ashley Yakeley wrote: > I considered doing something very like this for real (computable) > numbers, but because I couldn't properly make the type an instance of Eq, > I left it. Actually it was worse than that. Suppose I'm adding two > numbers, both of which are actually 1, but I don't know that

Re: infinite (fractional) precision

2002-10-10 Thread Ketil Z. Malde
Ashley Yakeley <[EMAIL PROTECTED]> writes: > At 2002-10-10 01:29, Ketil Z. Malde wrote: > > >I realize it's probably far from trivial, e.g. comparing two equal > >numbers could easily not terminate, and memory exhaustion would > >probably arise in many other cases. > > I considered doing someth

Re: infinite (fractional) precision

2002-10-10 Thread David Lester
Dear All, A really, really simple version in Haskell 1.2 has been available from ftp://ftp.cs.man.ac.uk/pub/arithmetic/Haskell/Era1/Era.hs for some considerable time. Of course the only reason for producing it was to show that the language designers didn't get it right. Take it from m

Re: infinite (fractional) precision

2002-10-10 Thread David Lester
On Thu, 10 Oct 2002, Jerzy Karczmarczuk wrote: > Ashley Yakeley wrote: > > > I considered doing something very like this for real (computable) > > numbers, but because I couldn't properly make the type an instance of Eq, > > I left it. Actually it was worse than that. Suppose I'm adding two > >

Re: infinite (fractional) precision

2002-10-10 Thread Dylan Thurston
On Thu, Oct 10, 2002 at 02:25:59AM -0700, Ashley Yakeley wrote: > At 2002-10-10 01:29, Ketil Z. Malde wrote: > > >I realize it's probably far from trivial, e.g. comparing two equal > >numbers could easily not terminate, and memory exhaustion would > >probably arise in many other cases. > > I con

Re: infinite (fractional) precision

2002-10-10 Thread Andrew J Bromage
G'day all. On Thu, Oct 10, 2002 at 11:50:39AM +0200, Jerzy Karczmarczuk wrote: > There are of course more serious approaches: intervals, etc. The infinite- > precision arithmetic is a mature domain, developed by many people. Actually > the Gosper arithmetic of continued fractions is also based o