Re: bigint/bugnum library

new topic     » goto parent     » topic index » view thread      » older message » newer message
jimcbrown said...
Spock said...

Out of curiosity, does anyone know the highest integer value at which Eu atoms are still stable for integral amounts. I might have to write a conversion program, which deals with monetary values, for my company and I'd rather avoid having to use a bignum library, if at all possible. A Eu integer maxes out at a billion, right? So if each integral represents one cent the integer would be useful for values up to $10 million. How much higher is the limit using atoms?

Spock

It's 2^53 (or 2 to the power of 53), same as a conventional C double: http://stackoverflow.com/questions/1848700/biggest-integer-that-can-be-stored-in-a-double

Thanks [to all] for the reply.

(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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu