replace wrap function with rem_euclid
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#[inline]
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user