-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed Point Arithmetic #12
Labels
new recipe 🍳
Request to add a new recipe
Comments
common pattern
testing
|
4meta5
added
tabled 🏓
maybe later...
and removed
srml tour 🎉
priority ⌛
top of the list!
labels
Aug 30, 2019
focusing on |
Maybe the recipe should be called Fixed Point Arithmetic. |
JoshOrndorff
added
new recipe 🍳
Request to add a new recipe
and removed
tabled 🏓
maybe later...
labels
Feb 16, 2020
Closed in #196 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a subtle difficulty when working with computers. Floating point arithmetic is nondeterminisic so the basic approach is to use a wrapper type that represents either
1_000_000
(Permill
) or1_000_000_000
(Perbill
) times the given floating point value.I've learned recently that this can get messy. I think it's worth doing a recipe on this.
Permill in docs
StackOverflow Question
Fixed64
The text was updated successfully, but these errors were encountered: