Skip to content

Let Modf ask for the remainder rather than computing it - #711

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
fix/modf-uses-the-operator
Aug 5, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
fix/modf-uses-the-operator

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

The follow-up I promised on #703.

Modf carried a private FlooredRemainder because, at the time it was written, the three numeric % operators each answered differently and none of them was the floored remainder the node wanted — Integer threw on a negative divisor, Real truncated, Rational was wrong. Since #708 landed they all are, so the helper now says by hand exactly what the operator says, and the switch goes back to n1 % n2.

Net -15 lines, no behaviour change. Suite Failed: 0, Passed: 4667, Skipped: 14, Total: 4681, with the 70 modulus tests from #703 and #709 passing unchanged — which is the point: they pin the four sign pairs, so if the operator and the helper had disagreed anywhere, they would say so.

First PR from a branch on this repository rather than from my fork, now that the fork has served its purpose.

The node carried its own FlooredRemainder because the three numeric % operators
each answered differently and none of them was the floored remainder it wanted.
Since #708 they all are, so the helper says by hand what the operator now says,
and the switch can go back to n1 % n2.

Suite 4667 passed, 0 failed.
@Rafael-SOWNet
Rafael-SOWNet merged commit b00ed78 into master Aug 5, 2026
24 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the fix/modf-uses-the-operator branch August 5, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant