repair go_fake_floor() so that fuzzy rounding works for negative (not just positive) inputs
Observed behavior
Let's focus attention on the int() spreadsheet function, which is implemented via go_fake_floor().
I assume the intent is the following:
If the input differs from the nearest integer by only one epsilon,
gnumeric uses the integer value instead.
Call this /fuzzy rounding/.
For positive numbers, I observe that the behavior can be described as follows: apply fuzzy rounding, then call POSIX floor().
In contrast, however, for negative numbers I observe that fuzzy rounding is not successfully applied. The observed behavior is identical to POSIX floor().
Here's a spreadsheet to demonstrate and visualize this: non-posix-floor.gnumeric
This is observed with gnumeric compiled from freshly pulled git sources.
Desired behavior
It would be nice to have consistent behavior across all inputs, negative as well as positive.
(IMHO it would be even better to have no fuzzy rounding. The plain POSIX behavior would be better, for many reasons ... but that's a discussion for another day. For now, let's settle for consistent application of fuzzy rounding.)
A patch is attached. The aforementioned spreadsheet can be used to verify that it works.