-
Notifications
You must be signed in to change notification settings - Fork 144
trait Euclid
takes args by reference instead of by value
#349
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
Comments
This difference occurs in a lot of our traits, and the main reason is so
That would be a breaking change. If you want the |
I'm using it in the context of rust-gpu where we conditionally use your #[cfg(target_arch = "spirv")]
use spirv_std::num_traits::Float; So for us, it is really important that these match with std. Also this just feels a bit silly to write (src): (a + d * 15.0).rem_euclid(&(d * 30.)) Could there be an option to implement |
I think that would introduce method ambiguity if anyone is already combining
The |
num-traits/src/ops/euclid.rs
Line 23 in 022f250
Is there any particular reason the functions of
trait Euclid
takes their args by reference, instead of by value? In stdf32::rem_euclid
also takes them by value, not reference, making them incompatible.Also, should
trait Float
depend on this trait to better match std?The text was updated successfully, but these errors were encountered: