Post Reply 
Arbitrary precision - two or three approaches
06-08-2022, 03:57 AM
Post: #6
RE: Arbitrary precision - two or three approaches
(06-07-2022 11:19 PM)Paul Dale Wrote:  I've seen a few arbitrary precision packages over the years. One that sticks in my mind was done in Haskell, sadly I don't remember it's name. The premise was that a number was represented as a sequence and whenever more digits were required, the sequence was extended until the desired digit values could be guaranteed to be correct. Want more digits later, keep extending.

Being Haskell and having lazy evaluation, it essentially built an expression tree for the computation and when more digits were required, potentially all the the nodes in the tree could be extended. Pretty neat idea but very memory intensive.

You mean this paper? https://link.springer.com/chapter/10.100...49498-1_16

Lazy evaluation (NOR+WHNF+sharing+lazy constructors to be precise) can make on-demand infinite precision elegant to implement e.g. in Haskell, Gofer, Miranda, etc.

So-called "arbitrary precision" packages are typically not producing digits on demand ad infinitum. Perhaps some package names may suggest otherwise, such as uLisp's "infinite precision arithmetic" package, which is a bignum package.

- Rob

"I count on old friends to remain rational"
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Arbitrary precision - two or three approaches - robve - 06-08-2022 03:57 AM



User(s) browsing this thread: 1 Guest(s)