Numeric: Rational Number Handling w/ Rounding Error Control
[Query Object Framework]


Detailed Description

The 'Numeric' functions provide a way of working with rational numbers while maintaining strict control over rounding errors when adding rationals with different denominators. The Numeric class is primarily used for working with monetary amounts, where the denominator typically represents the smallest fraction of the currency (e.g. pennies, centimes). The numeric class can handle any fraction (e.g. twelfth's) and is not limited to fractions that are powers of ten.

A 'Numeric' value represents a number in rational form, with a 64-bit integer as numerator and denominator. Rationals are ideal for many uses, such as performing exact, roundoff-error-free addition and multiplication, but 64-bit rationals do not have the dynamic range of floating point numbers.

See gncnumericexample


Files

file  gnc-numeric.h
 An exact-rational-number library for gnucash. (to be renamed qofnumeric.h in libqof2).

Data Structures

struct  _gnc_numeric

Typedefs

typedef _gnc_numeric gnc_numeric
 An rational-number type.


Typedef Documentation

typedef struct _gnc_numeric gnc_numeric
 

An rational-number type.

This is a rational number, defined by numerator and denominator.

Definition at line 62 of file gnc-numeric.h.


Generated on Fri May 12 18:00:35 2006 for QOF by  doxygen 1.4.4