if you are interested in arbitrary precision math here are some interesting papers on the subject http://www.hvks.com/Numerical/papers.html
the main page is http://www.hvks.com/Numerical/arbitrary_precision.html
I have dabbled with arbitrary precision math and plan on refining my routines using information from those papers
numerical papers
Re: numerical papers
Thanks for posting this Jack, this is an interesting area. I have only been working with typed languages such as PB for a short time, but something has been concerning me as I get further into my main project — the 8-byte limitation of quads and integers. Much of my past work has been with the PICK multivalue database (it used to be a native O/S), in which almost everything is treated as an unlimited-length string.
I have to confess, I was unfamiliar with the term arbitrary precision but having read briefly about it following your post, I saw the following...
"Rather than storing values as a fixed number of bits related to the size of the processor register, these implementations typically use variable-length arrays of digits. "
Essentially, this is what PICK does and has been around for several decades — all numerics are in fact strings. I can imagine that it isn't easy to replicate this in an environment where it becomes necessary to convert back into a fixed number of bits to perform calculations. I would think perhaps the solution is to break values down into smaller units.
Re: numerical papers
Thanks Jack for this website. Definitely valuable for my scripting language Lizard where I have implemented arbitrary precision math.
For an optimal implementation, usually you work on processor level and use the "carry" values of the basic operations like addition and multiplication to handle big numbers as "processor-word-arrays".Oso wrote: ↑Tue Dec 06, 2022 8:35 pm Essentially, this is what PICK does and has been around for several decades — all numerics are in fact strings. I can imagine that it isn't easy to replicate this in an environment where it becomes necessary to convert back into a fixed number of bits to perform calculations. I would think perhaps the solution is to break values down into smaller units.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: numerical papers
Now that you mention it STARGÅTE, I remember reading your linked thread about Lizard some months ago when I first found PB. Yes, it's quite relevant given the mathematical limitations otherwise — maybe it should become part of PB. It would certainly set PB apart from its competitors.