aurum-numeric 0.2.0

Numeric traits
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (c) 2016-2017 <daggerbot@gmail.com>
// This software is available under the terms of the zlib license.
// See COPYING.md for more information.

/// Get the square root of a number.
pub trait Sqrt {
    fn sqrt (self) -> Self;
}

#[cfg(feature = "std")]
impl Sqrt for f32 {
    fn sqrt (self) -> f32 { self.sqrt() }
}

#[cfg(feature = "std")]
impl Sqrt for f64 {
    fn sqrt (self) -> f64 { self.sqrt() }
}