Add NumCast to FloatCore, matching Float
This commit is contained in:
parent
ac503261ca
commit
7d6575da0f
|
@ -6,14 +6,12 @@ use core::num::FpCategory;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use std::f32;
|
use std::f32;
|
||||||
|
|
||||||
use {Num, ToPrimitive};
|
use {Num, NumCast, ToPrimitive};
|
||||||
#[cfg(feature = "std")]
|
|
||||||
use NumCast;
|
|
||||||
|
|
||||||
/// Generic trait for floating point numbers that works with `no_std`.
|
/// Generic trait for floating point numbers that works with `no_std`.
|
||||||
///
|
///
|
||||||
/// This trait implements a subset of the `Float` trait.
|
/// This trait implements a subset of the `Float` trait.
|
||||||
pub trait FloatCore: Num + Neg<Output = Self> + PartialOrd + Copy {
|
pub trait FloatCore: Num + NumCast + Neg<Output = Self> + PartialOrd + Copy {
|
||||||
/// Returns positive infinity.
|
/// Returns positive infinity.
|
||||||
fn infinity() -> Self;
|
fn infinity() -> Self;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue