-
Hey folks, I didn't want to instantaneously create an issue for this as it might be intended behavior and perhaps I'm stupid. Today I ran into a strange issue where dividing a larger number by 3 creates numbers that have a whole bunch of zeroes smacked onto them. console2.log(sd(46000e18).div(sd(3)).unwrap()); // 15333333333333333333333333333333333333333
console2.log(sd(46000e18).mul(sd(1).div(sd(3))).unwrap()); // 15333333333333333318000 Is there something I'm not seeing/aware of or is this strange behavior? |
Beta Was this translation helpful? Give feedback.
Answered by
PaulRBerg
Oct 21, 2023
Replies: 1 comment 1 reply
-
Thanks for your question!
You perhaps wanted to divide by |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hellowodl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for your question!
sd(3)
is actually 3e-18 in normal numbers (recall that this is a fixed-point math library).You perhaps wanted to divide by
sd(3e18)
.