cosf review
This commit is contained in:
parent
7959f0cea9
commit
d8cc25edd3
7 changed files with 17 additions and 18 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use super::service::{cosdf, sindf, rem_pio2f};
|
||||
use super::{cosdf, sindf, rem_pio2f};
|
||||
|
||||
use core::f64::consts::FRAC_PI_2;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ mod expf;
|
|||
mod floor;
|
||||
mod cosf;
|
||||
|
||||
mod service;
|
||||
|
||||
pub use self::{
|
||||
fabs::fabs,
|
||||
fabsf::fabsf,
|
||||
|
|
@ -34,6 +32,18 @@ pub use self::{
|
|||
cosf::cosf,
|
||||
};
|
||||
|
||||
mod sindf;
|
||||
mod cosdf;
|
||||
mod rem_pio2f;
|
||||
mod rem_pio2_large;
|
||||
|
||||
use self::{
|
||||
sindf::sindf,
|
||||
cosdf::cosdf,
|
||||
rem_pio2f::rem_pio2f,
|
||||
rem_pio2_large::rem_pio2_large,
|
||||
};
|
||||
|
||||
fn isnanf(x: f32) -> bool {
|
||||
x.to_bits() & 0x7fffffff > 0x7f800000
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use ::scalbn;
|
||||
use ::F64Ext;
|
||||
use super::scalbn;
|
||||
use super::floor;
|
||||
|
||||
/// double x[],y[]; int e0,nx,prec;
|
||||
///
|
||||
|
|
@ -323,8 +323,8 @@ pub(crate) fn rem_pio2_large(x : &[f64], y : &mut [f64], e0 : i32, prec : usize)
|
|||
}
|
||||
|
||||
/* compute n */
|
||||
z = scalbn(z, q0); /* actual value of z */
|
||||
z -= 8.0*(z*0.125).floor(); /* trim off integer >= 8 */
|
||||
z = scalbn(z, q0); /* actual value of z */
|
||||
z -= 8.0*floor(z*0.125); /* trim off integer >= 8 */
|
||||
n = z as i32;
|
||||
z -= n as f64;
|
||||
ih = 0;
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
mod sindf;
|
||||
mod cosdf;
|
||||
mod rem_pio2f;
|
||||
mod rem_pio2_large;
|
||||
|
||||
pub(crate) use self::{
|
||||
cosdf::cosdf,
|
||||
sindf::sindf,
|
||||
rem_pio2f::rem_pio2f,
|
||||
rem_pio2_large::rem_pio2_large,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue