Decimal Arithmetic

Dar Scott dsc at swcp.com
Mon Dec 15 17:40:21 EST 2003


As is my habit in the month of Dec, my mind has wandered to decimal 
(point) arithmetic.  Decimal can be handy if the normal Revolution 
arithmetic is discovered to be way too fast.  (It can also be useful in 
avoiding accumulated binary fraction errors.)

I have been thinking of fixed point numbers, something like this:

+/-99,999,999,999,999.99999999999999

Where might I find that too constraining?
Where might others (you) find it too constraining?
Where might this be especially useful?

I have also been pondering on...
fixed point with more digits
unbounded integer arithmetic (any number of digits)
unbounded fixed point (any digits to left of decimal)
unbounded with indefinite accuracy (and any digits to right)
fixed precision decimal floating point
indefinite (adjusting) precision decimal floating point

These (and ordinary Revolution arithmetic) might be combined with...
interval arithmetic
vector arithmetic
complex arithmetic

Some transcendental functions would be handy and might apply to some or 
most of these.  These would be very slow in some cases.  Some 
interesting integer math functions might also apply to some of these.

Of all these, I think I would use complex the least, but I bet there 
are folks who would use complex a lot.

Dar

****************************************
     Dar Scott Consulting
     http://www.swcp.com/dsc/
     Programming Services
****************************************



More information about the Use-livecode mailing list