Replies: 2 comments
-
This would also be more in line with the behavior of most other functions in the repo, e.g. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I ended up implementing this in 21fb327. The only downside is the fact that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
mul
function usesmulDiv18
, which rounds up in case the remainder is at least 0.5:https://github.com/paulrberg/prb-math/blob/fdb08284161bd14fb6d8a9ceceb36d181985259f/src/Helpers.sol#L213-L216
Pasting the NatSpec:
The trouble with this behavior is twofold:
Always truncating shouldn't be an issue for the vast majority of use cases. Who needs exact 18 decimal precision, anyway?
Beta Was this translation helpful? Give feedback.
All reactions