Files
gnucash/bindings/python
Ryan Duguid faf7a9999d [bindings/python] Floor GncNumeric // and make int() exact
GncNumeric // truncated towards zero, so GncNumeric(-7, 2) // 1 gave -3
where Python's // floors to -4. int() converted through a float and
lost precision above 2**53: int(GncNumeric(2**53 + 1)) returned
9007199254740992. Round // with GNC_HOW_RND_FLOOR and convert int()
through the exact fraction.

int() now goes through to_fraction(), which read a negative
denominator as a divisor; GnuCash treats it as a multiplier, so
GncNumeric(3, -100) is 300. to_fraction() now does the same.
2026-10-30 09:14:23 +11:00
..