round_ties_even in core::f64::math - Rust
Description: Experimental version of `round_ties_even` in `core`. See `f64::round_ties_even` for details.

## round_ties_even

# Function round_ties_even

Source

    pub const fn round_ties_even(x: f64) -> f64

🔬This is a nightly-only experimental API. (`core_float_math` #137578)
Expand description

Experimental version of `round_ties_even` in `core`. See `f64::round_ties_even` for details.

## §Examples

    #![feature(core_float_math)]

    use core::f64;

    let f = 3.3_f64;
    let g = -3.3_f64;
    let h = 3.5_f64;
    let i = 4.5_f64;

    assert_eq!(f64::math::round_ties_even(f), 3.0);
    assert_eq!(f64::math::round_ties_even(g), -3.0);
    assert_eq!(f64::math::round_ties_even(h), 4.0);
    assert_eq!(f64::math::round_ties_even(i), 4.0);

This standalone function is for testing only. It will be stabilized as an inherent method.