3 ms·
>Btw: I'm looking for efficient ways to represent numbers of arbitrary precision, and performing mathematical operations on the them The easiest way is to look
by constantcrying 2y ago
>Btw: I'm looking for efficient ways to represent numbers of arbitrary precision, and performing mathematical operations on the them
The easiest way is to look at how fixed length numbers are implemented and extend the ranges of values to arbitrary length.
For financial operations it seems likely that you want fixed point arithmetic, which essentially just means you calculate in integers of cents. So you just need to implement arbitrary length integers, which isn't particularly hard I would say. The algorithms you need are the ones you already know from school. Long division and multiplication. (There are better ones though).