use inline, not inline(always)
This commit is contained in:
parent
32bfd1b27e
commit
a0af942255
@ -1,7 +1,7 @@
|
||||
// Previously from trig.rs
|
||||
// From https://bits.stephan-brumme.com/absFloat.html
|
||||
#[allow(dead_code)]
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn abs(x: f32) -> f32 {
|
||||
return f32::from_bits(x.to_bits() & 0x7FFF_FFFF);
|
||||
}
|
||||
@ -9,7 +9,7 @@ fn abs(x: f32) -> f32 {
|
||||
// Previously from trig.rs
|
||||
// Branchless floor implementation
|
||||
#[allow(dead_code)]
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn floor(x: f32) -> f32 {
|
||||
let mut x_trunc = (x as i32) as f32;
|
||||
x_trunc -= (x < x_trunc) as i32 as f32;
|
||||
@ -20,7 +20,7 @@ fn floor(x: f32) -> f32 {
|
||||
// Approximates `cos(x)` in radians with the maximum error of `0.002`
|
||||
// https://stackoverflow.com/posts/28050328/revisions
|
||||
#[allow(dead_code)]
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn cos(mut x: f32) -> f32 {
|
||||
const ALPHA: f32 = 0.5 * std::f32::consts::FRAC_1_PI;
|
||||
x *= ALPHA;
|
||||
@ -33,7 +33,7 @@ pub fn cos(mut x: f32) -> f32 {
|
||||
// Previously from trig.rs
|
||||
// Approximates `sin(x)` in radians with the maximum error of `0.002`
|
||||
#[allow(dead_code)]
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn sin(x: f32) -> f32 {
|
||||
return cos(x - std::f32::consts::FRAC_PI_2);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user