Skip to content

Narrow RoundingNecessaryException for plus/minus/multipliedBy with int arg#16

Merged
simPod merged 1 commit intomainfrom
narrow-int-arithmetic-rounding
Mar 15, 2026
Merged

Narrow RoundingNecessaryException for plus/minus/multipliedBy with int arg#16
simPod merged 1 commit intomainfrom
narrow-int-arithmetic-rounding

Conversation

@simPod
Copy link
Owner

@simPod simPod commented Mar 15, 2026

Integer arithmetic (plus, minus, multipliedBy) on Money always produces an exact result that fits the same context (any scale, any step), so rounding cannot occur.

This eliminates RoundingNecessaryException for these operations when the argument is statically known to be int. dividedBy is excluded since integer division can genuinely need rounding (e.g. $1 / 3).

…t arg

Integer arithmetic on Money always produces an exact result that fits
the same context (any scale, any step), so rounding cannot occur.
This eliminates RoundingNecessaryException for these operations when
the argument is statically known to be int.
@simPod simPod merged commit 1f0e57c into main Mar 15, 2026
8 checks passed
@simPod simPod deleted the narrow-int-arithmetic-rounding branch March 15, 2026 09:28
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