-
Notifications
You must be signed in to change notification settings - Fork 147
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
Implement to_radians and to_degrees for Float #211
Comments
Curious that those are missing. Is there anything else in It's a breaking change to add methods to a trait, unless you provide a default implementation. Is there a way to generically write these? Then |
Relevant discussion in georust/geo#48 by the way. Feel free to take any of my code I wrote. |
Ugh. Rust 1.0 had these stable for |
What would be the next step forward for this? In what way would it be a breaking change? Do you think it'd be possible to write a default implementation? |
It's a little annoying since their |
To avoid a breaking change, these have crude default implementations as well as better implementations for `f32` and `f64` in particular. They don't use the inherent methods though, because `f32` didn't stabilize those until Rust 1.7. Fixes rust-num#211
Please let me know if #212 looks ok to you. |
traits: add `to_degrees` and `to_radians` on `Float` To avoid a breaking change, these have crude default implementations as well as better implementations for `f32` and `f64` in particular. They don't use the inherent methods though, because `f32` didn't stabilize those until Rust 1.7. Fixes #211
Implement indexing into Value
https://doc.rust-lang.org/nightly/std/primitive.f64.html#method.to_degrees
https://doc.rust-lang.org/nightly/std/primitive.f64.html#method.to_radians
To better mirror what's offered in the standard library, it'd be nice if these methods were available for any
Float
.The text was updated successfully, but these errors were encountered: