On Wed, Mar 23, 2011 at 1:30 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > On 3/23/2011 1:46 PM, TR Shaw wrote: >> Current US national debt is 16 digits. > > A 64-bit unsigned integer can represent about $18 trillion, in > millionths of a dollar. This should have both range and accuracy to > spare, for most applications, but you can always trade one for the other > (e.g. use units of 1/1000 of a dollar instead, for a 100 times greater > range).
I made the same point, but that doesn't leave much of a comfort zone. First of all, totaling up all assets and liabilities in the U.S. economy, including pension funds, Social Security, Medicare, etcetera, quickly gets you numbers larger than $100 trillion. Second, a few more decades like the last few and 2^63 will not suffice to total up all of those numbers using 1/1,000th of a dollar as the unitm yet without significant inflation a cent will still be the absolute smallest unit we'll get by with. Third, any bout of hyperinflation (which some worry about) will mean that for a fairly long period of time people will need a very large range to represent monetary amounts with 1/1,000th of a dollar as the unit -- even if it doesn't happen (and let us hope it doesn't), the range is getting uncomfortably small. So, yeah, 64-bit integers are a bit too small for representing monetary amounts. By the time this becomes critical I'm sure SQLite will no longer be quite so light, and will have grown bignum support :) But now is a good time to start asking whether 64-bit integers will do, and for how long. Nico -- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users