sin/cos optimizations, cleanup, and optimizations

This commit is contained in:
Simon Gardling
2021-03-30 12:54:57 -04:00
parent 6e2b5c3d2a
commit f76c9f7401
9 changed files with 99 additions and 33 deletions

View File

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