_{1}*k

^{m}+ n

_{2}*k

^{m-1}+ ... + n

_{i}*k

^{m-(i-1)}[i'll call it sum of

*partial multiplications*] where k,m,n are integer numbers (or even an 'unlimited-length' integer: bigint, or a list of digits), and i is an integer of unlimited length.

Let's define arithmetic operations on such number form, and we can have

**base-k arbitrary precision arithmetics**.

Object Oriented paradigm can be used to define

*partial multiplication*class, and sum of them too

*(arbitrary precision number, or shortly: Number)*.

Such

*Number*can be used to define

*PreciseNumber*.

*PreciseNumber*is similar to

*Number*, except that we can use

*Numbers*or

*PreciseNumbers*instead of integers for k,m,n. It allows for much better precision, number's magnitude, and memory use.

See also: How to precisely count using computers.

ReplyDeleteSee also: base-k arbitrary precision arithmetics implementation : http://intelligent-devices.blogspot.com/2013/09/base-k-arithmetics-implementation.html

ReplyDeleteupdating link: http://dragonfly-algorithm.blogspot.com/2013/09/base-k-arithmetics-implementation.html

ReplyDelete