replace wrap function with rem_euclid
This commit is contained in:
parent
4330101b68
commit
ff769df97b
@ -1,6 +1,7 @@
|
|||||||
#[inline]
|
#[inline]
|
||||||
pub fn wrap(x: f32, max: f32) -> f32 {
|
pub fn wrap(x: f32, max: f32) -> f32 {
|
||||||
x - max * ((x > max) as i32 - x.is_sign_negative() as i32) as f32
|
// x - max * ((x > max) as i32 - x.is_sign_negative() as i32) as f32
|
||||||
|
x.rem_euclid(max)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Truncate x and y and return a corresponding index into the data slice.
|
/// Truncate x and y and return a corresponding index into the data slice.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user