pub fn roundf(d: f32) -> f32 {
    let mut x = d + 0.5;
    let mut fr = x - (x as i32 as f32);
    if (fr == 0.) && (x <= 0.) {
        x -= 1.
    };
    fr = if fr < 0. { fr + 1. } else { fr };
    x = if d == 0.499_999_970_197_677_612_3 {
        0.
    } else {
        x
    }; // nextafterf(0.5, 0)
    if d.is_infinite() || (fabsfk(d) >= F1_23) {
        d
    } else {
        copysignfk(x - fr, d)
    }
}
/// Round to integer away from zero
Round to integer away from zero
Round to integer away from zero
pub fn roundf(d: f32) -> f32 {
    let mut x = d + 0.5;
    let mut fr = x - (x as i32 as f32);
    if (fr == 0.) && (x <= 0.) {
        x -= 1.
    };
    fr = if fr < 0. { fr + 1. } else { fr };
    x = if d == 0.499_999_970_197_677_612_3 {
        0.
    } else {
        x
    }; // nextafterf(0.5, 0)
    if d.is_infinite() || (fabsfk(d) >= F1_23) {
        d
    } else {
        copysignfk(x - fr, d)
    }
}
pub fn roundf ( d : f32 ) -> f32 { let mut x = d + 0.5 ; let mut fr = x - ( x as i32 as f32 ) ; if ( fr == 0. ) && ( x <= 0. ) { x -= 1. } ; fr = if fr < 0. { fr + 1. } else { fr } ; x = if d == 0.499_999_970_197_677_612_3 { 0. } else { x } ; // nextafterf(0.5, 0) if d . is_infinite ( ) || ( fabsfk ( d ) >= F1_23 ) { d } else { copysignfk ( x - fr , d ) } }
Round to integer away from zero
Round to integer away from zero
d
f32
d
f32