Jim Starkey <[email protected]> writes: > But as I have mentioned before, dropping into arbitrary precision > binary to handle currency is really foolish. A 64 bit int can hold a > lot of dollars and cents and is a hell of a lot faster than arbitrary
Yes, 64-bit ints holding centi-cents sounds quite good for currency, 18 digits of precision (19 for insigned). (And a $200 CPU can do 30 billion 64-bit additions/subtractions per second.) I once attended a talk from someone who developed a system that handles pension funds for every person in Sweden. Their problem was with the application language (which was Perl), which does not have any native 64-bit integer (they ended up working with some bignum package). Now that I think it over, I do not remeber seeing a 64-bit integer type in any high-level application language. Perl does not have it, Javascript does not. I think Java used to not have it, maybe it's been included in Java/.NET by now. I don't think PHP has it either, not sure about PHP/Python? It's common for application/scripting languages to use IEEE doubles for numbers. But they have only 14 digits of precision, and that was just below the requirements for the Swedish pension system at least (I don't really remember, but it was something like needing 6 places after the decimal point, and magnitudes up to 1 billion before, which translates to 15 digits). - Kristian. _______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

