This commit is contained in:
Simon Gardling
2021-03-31 13:36:46 -04:00
parent 6591de7dec
commit b5bc14faa3
7 changed files with 68 additions and 70 deletions

View File

@@ -1,4 +1,4 @@
#[inline(always)]
pub fn wrap(x: f32, max: f32) -> f32 {
return x - max * ((x > max) as i32 as f32 - (x < 0.0_f32) as i32 as f32);
x - max * ((x > max) as i32 as f32 - (x < 0.0_f32) as i32 as f32)
}