Skip to content

Commit

Permalink
Merge pull request #13 from burrbull/more_tests
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
burrbull committed Aug 1, 2022
2 parents ea47510 + a67039b commit 7505b39
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/f32.rs
Expand Up @@ -1257,15 +1257,15 @@ pub fn nextafterf(x: f32, y: f32) -> f32 {
let mut cxi = (if x == 0. { mulsignf(0., y) } else { x }).to_bits() as i32;
let c = (cxi < 0) == (y < x);
if c {
cxi = -(cxi ^ (1 << 31));
cxi = -(cxi ^ i32::MIN);
}

if x != y {
cxi -= 1;
}

if c {
cxi = -(cxi ^ (1 << 31));
cxi = -(cxi ^ i32::MIN);
}

let cxf = f32::from_bits(cxi as u32);
Expand Down
4 changes: 2 additions & 2 deletions src/f32x.rs
Expand Up @@ -1062,11 +1062,11 @@ macro_rules! impl_math_f32 {
let mut xi2 = I32x::from_bits(x);
let c = x.is_sign_negative() ^ y.ge(x);

xi2 = c.select(I32x::splat(0) - (xi2 ^ I32x::splat(1 << 31)), xi2);
xi2 = c.select(I32x::splat(0) - (xi2 ^ I32x::splat(i32::MIN)), xi2);

xi2 = x.ne(y).select(xi2 - I32x::splat(1), xi2);

xi2 = c.select(I32x::splat(0) - (xi2 ^ I32x::splat(1 << 31)), xi2);
xi2 = c.select(I32x::splat(0) - (xi2 ^ I32x::splat(i32::MIN)), xi2);

let mut ret = F32x::from_bits(xi2);

Expand Down
2 changes: 1 addition & 1 deletion src/f64x.rs
Expand Up @@ -693,7 +693,7 @@ macro_rules! impl_math_f64 {
let o = d.lt(F64x::splat(4.909_093_465_297_726_6_e-91));
d = o.select(F64x::splat(2.037_035_976_334_486_e90) * d, d);
let mut q = cast_from_upper(U64x::from_bits(d));
q &= Ix::splat(((1 << 12) - 1) << 20);
q &= Ix::splat((((1u32 << 12) - 1) << 20) as _);
q = Ix::from_bits(Ux::from_bits(q) >> 20);
q - Mx::from_cast(o).select(Ix::splat(300 + 0x3ff), Ix::splat(0x3ff))
}
Expand Down
2 changes: 1 addition & 1 deletion src/f64x/u35_impl.rs
Expand Up @@ -619,7 +619,7 @@ macro_rules! impl_math_f64_u35 {

ql = Mx::from_cast(g).select(ql, dql.roundi());
s = g.select(s, u);
let g = d.abs().lt(F64x::splat(1e+7));
let g = d.abs().lt(F64x::splat(1e+6));

if !g.all() {
let (ddidd, ddii) = rempi(d);
Expand Down

0 comments on commit 7505b39

Please sign in to comment.