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

## sqrt

# Function sqrt

Source

    pub fn sqrt(x: f64) -> f64

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

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

## §Examples

    #![feature(core_float_math)]

    use core::f64;

    let positive = 4.0_f64;
    let negative = -4.0_f64;
    let negative_zero = -0.0_f64;

    assert_eq!(f64::math::sqrt(positive), 2.0);
    assert!(f64::math::sqrt(negative).is_nan());
    assert_eq!(f64::math::sqrt(negative_zero), negative_zero);

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