src/types.rs

branch
dev
changeset 195
93e003c1f0ef
parent 150
c4e394a9c84c
equal deleted inserted replaced
194:a5ee4bfb0b87 195:93e003c1f0ef
95 /// Trait for signed numeric types 95 /// Trait for signed numeric types
96 pub trait SignedNum: Num + num::Signed + std::ops::Neg<Output = Self> {} 96 pub trait SignedNum: Num + num::Signed + std::ops::Neg<Output = Self> {}
97 impl<U: Num + num::Signed + std::ops::Neg<Output = Self>> SignedNum for U {} 97 impl<U: Num + num::Signed + std::ops::Neg<Output = Self>> SignedNum for U {}
98 98
99 /// Trait for floating point numbers 99 /// Trait for floating point numbers
100 pub trait Float: SignedNum + num::Float /*+ From<Self::CompatibleSize>*/ { 100 pub trait Float: SignedNum + std::fmt::LowerExp + num::Float /*+ From<Self::CompatibleSize>*/ {
101 // An unsigned integer that can be used for indexing operations and 101 // An unsigned integer that can be used for indexing operations and
102 // converted to F without loss. 102 // converted to F without loss.
103 //type CompatibleSize : CompatibleUnsigned<Self>; 103 //type CompatibleSize : CompatibleUnsigned<Self>;
104 104
105 const PI: Self; 105 const PI: Self;

mercurial