Re: bigint/bugnum library
- Posted by jimcbrown (admin) Jul 13, 2013
- 1730 views
(2 ^53) /100 = 90,071,992,547,409.92 (90 trillion)
To prevent any (digit-based) overflow I should limit the max number of digits which then would give me an upper limit of 10 trillion less one cent.
The highest grossing companies have revenues approaching 1/2 a trillion USD so this method of storing monetary amounts would safely work for any one company, even a massive one, for many years. For our medium size company that limit will never be breached, so my code will never crash. Yay!
Spock
Glad to hear that it works for your purposes. Of course, for economists doing calculations on the world economy (something like $60 trillion USD GDP iirc), this isn't enough, so I think we still need a money math lib. A BCD lib would make a lot of sense as well.