Adopt banker's rounding for interest calculations #4573
Labels
Core Economy
OBSOLETE in favor of INTER-protocol
enhancement
New feature or request
restival
to be done before RUN Protocol Purple Team festival
Milestone
What is the Problem Being Solved?
As yet we have two rounding methods for integer division (ceil and floor). Because of the repeated division operations in how #4527 tracks compounded interest, those strategies produce measurable skew.
Description of the Design
A rounding strategy without bias toward/away from zero is Round half to even. (It is also free of positivity/negativity bias, which isn't relevant to interest calculation but would have other applications.)
This strategy is also known as bankers' rounding and is the default rounding mode used in IEEE 754 operations for results in binary floating-point formats.
Security Considerations
Test Plan
The text was updated successfully, but these errors were encountered: