High precision decimal arithmetic

Dar Scott dsc at swcp.com
Fri Nov 22 12:19:02 EST 2002


Some months ago some discussion indicated some limitations to the 
available precision and to use of a binary point in Revolution 
arithmetic.

I'm hoping to get my workload down by mid December so that I can take a 
couple days to build my first pass at a high precision decimal 
arithmetic library.  By "decimal", I mean a virtual decimal point.  By 
"high precision", I mean more digits than standard.  I will start out 
simple and then perhaps make something fancier.  I'll add trig and such 
to what I like best.

This kind of thing has advantages but has some obvious disadvantages.  
All operations and most relations will be by functions, making 
expressions a little harder to read.  Computation time will be much 
slower.  Conversion to and from text strings will most likely have to be 
explicit.

I have a couple questions.

1.
Am I reinventing the wheel?  Does someone have something like this 
available or in the oven?

2.
I got to thinking that there might be others interested in this kind of 
thing and there might be an advantage to me to make something that meets 
popular needs.  (I'm content should I be the only one.)

What kind of high precision decimal arithmetic would people be 
interested in tinkering with, find useful, or even have needs for?  How 
many digits total?  How many digits to the right of the decimal point?

Some ideas:

Fixed point--  18 digits total, six past the decimal point?  30 digits 
total, 12 past the decimal point?

Floating point--  18 digits total?  36 digits total?  Total digits at 
least as much as specified in a property?

Indefinite--  total digits limited by memory (or property?).  12 digits 
to the right of the decimal point?  Digits to the right greater than or 
equal a number in a property?

I have almost a month before I hope to make a stab at this, so your 
pondering a little before commenting is OK for my schedule.

Dar Scott




More information about the use-livecode mailing list