This commit is contained in:
Simon Gardling
2021-03-31 10:24:56 -04:00
parent bec6340607
commit 32bfd1b27e
9 changed files with 66 additions and 54 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);
}
}