A new C++ implementation of 128-bit math replaces qofmath128.c with
gnc-int128.cpp, and the gnc-numeric arithmetic operations now wrap
the equivalent functions in a new GncRational class, which works with
a GncDenom class to handle rounding and denominator-type settings.
All arithmetic is now done with 128 bits of precision and no overflows
are signalled until conversion back to the int64_t-based gnc_numeric.
C++ clients will be able to use GncRational directly, at which point
some of its other functionality can be added; this will allow chained
128-bit arithmetic, which will permit more complicated calculations
without overflow.
Operators are not implemented for GncRational (they are for GncInt128,
which makes the GncRational implemntation much easier to read) because
of the need for passing denominator and rounding specs.
One source of overflow during testing was changing the denominator on a
max-precision number. If the numerator was clamped with a large denominator,
changing to a smaller denominator without rescaling created a number that
would overflow later when applied to a commodity with a different SCU. This
change re-scales numerators in those cases so that the overflows don't happen.
The lot creation and balancing code uses gnc_numeric_foo_fixed(), assuming that
all amounts in a split have the same denominator, the account's SCU. Ensuring
this when creating test cases prevents spurious failures.
LCD denom was equivalent to using rounding.denom, which is val.denom * 10.
If val.num was at the max # of digits that would overflow, so instead
fix val.denom and actually round the result; since we're adding
5/(val.denom * 10) to accomplish the rounding we want to truncate the result.
Increases the possible denominators to 1E10, but clamps the numerator to
1E13 * denom with 1E19 max. This is equivalent to $1E8/1 US in
Indonesian Rupiah, the currency with the lowest per-unit value in the
world at the time of this commit.
These changes hardcoded the standards-reports path at build time.
On Windows and OS X the final path is only known at installation time.
So after installation the build-time hard-coded path would be invalid and
the standard-reports directory could no longer be found.
Fixed conflicts:
src/test-core/Makefile.am
Most important changes:
* precompile scm files in case guile 2 is detected
* several new and updated translations
* several bugfixes since the 2.6.4 release