More digit in currency
Linas Vepstas
linas at linas.org
Tue Jun 22 22:53:18 EDT 2004
On Tue, Jun 22, 2004 at 03:29:25PM -0400, Derek Atkins was heard to remark:
> need to represent one trillionth of a dollar?
Note also, gnucash stores its numbers, and does its math using exact
ratios wherever it can, and not floating point numbers. An "exact
ratio" is a number n/d where both n and d are integers. The goal
of using exact math is to avoid rounding errors. Thus, it does not
make sense to store values in units smaller than the smallest
legal currency unit (scu). For adding and subtracting, a rounding
error can never be made. Multiplies and divides only show in a few
places, such as price calculations -- but one never adds prices.
The only place where mutiples/divides and addition/subtraction are
mixed are interest-rate calculations; these should probably be
reviewed for correctness in handling rounding.
This should probably be places in some gnucash faq somewhere, if its not
in the docs already.
--linas
--
pub 1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <linas at linas.org>
PGP Key fingerprint = 8305 2521 6000 0B5E 8984 3F54 64A9 9A82 0104 5933
More information about the gnucash-user
mailing list