gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sat Apr 8 12:10:33 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/2035806d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fd6234f5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a467d0d3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/de1c56b5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e55b7861 (commit)
	from  https://github.com/Gnucash/gnucash/commit/6e7334fe (commit)



commit 2035806db7bb33c6e8e9e641d84b2386424f6658
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Apr 7 12:39:47 2017 -0700

    Some instrumentation output for how much the numerator or denominator is shifted.

commit fd6234f58fd436b6c31aa3b4f0f98aa008ea5aea
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Apr 7 12:38:55 2017 -0700

    Better manage truncation in GncRational::round_to_numeric.
    
    Mike Alexander brought this up with a test case that failed to round down
    sufficiently; he found that reducing the rounding denominator by 2 sufficed
    to make his test case pass.
    
    In fact the sizing of the replacement denominator by shifting the larger of
    the numerator or denominator by an arbitrary 62 bits was not correct most
    of the time, so instead we begin with a shift of the full lower leg worth,
    try to do the conversion, and if the conversion is still “big” shift the
    larger value one more and try the operation again, repeating until the
    result will fit in a GncNumeric.

commit a467d0d397ada9ea056c536b16bd901947b3dfb7
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Apr 7 12:29:04 2017 -0700

    Fix GncInt128 maxbits to account for the flag bits.

commit de1c56b53d62df0d6f0f86dbfe22b043f530f132
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Apr 7 12:27:59 2017 -0700

    Fix carrying to the wrong end of the lower leg in left shift.

commit e55b78614cc6e124eb72a214f2ab8d6da7cb1a9e
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Apr 7 12:26:51 2017 -0700

    Fix a magic number in GncInt128.



Summary of changes:
 src/libqof/qof/gnc-int128.cpp              | 14 +++++---
 src/libqof/qof/gnc-int128.hpp              |  3 +-
 src/libqof/qof/gnc-rational.cpp            | 58 +++++++++++++++++++++++-------
 src/libqof/qof/gnc-rational.hpp            | 10 ++++--
 src/libqof/qof/test/gtest-gnc-int128.cpp   | 15 ++++++++
 src/libqof/qof/test/gtest-gnc-numeric.cpp  | 13 ++++---
 src/libqof/qof/test/gtest-gnc-rational.cpp | 30 +++++++++-------
 7 files changed, 108 insertions(+), 35 deletions(-)



More information about the gnucash-patches mailing list