src/types.rs

changeset 199
32f5062ee477
parent 195
93e003c1f0ef
equal deleted inserted replaced
198:3868555d135c 199:32f5062ee477
9 absolutely necessary to use nalgebra. 9 absolutely necessary to use nalgebra.
10 */ 10 */
11 11
12 //use trait_set::trait_set; 12 //use trait_set::trait_set;
13 pub use num_traits::cast::AsPrimitive; 13 pub use num_traits::cast::AsPrimitive;
14 pub use num_traits::float::TotalOrder;
14 pub use num_traits::Float as NumTraitsFloat; // needed to re-export functions. 15 pub use num_traits::Float as NumTraitsFloat; // needed to re-export functions.
15 16
16 pub use simba::scalar::{ 17 pub use simba::scalar::{
17 ClosedAdd, ClosedAddAssign, ClosedDiv, ClosedDivAssign, ClosedMul, ClosedMulAssign, ClosedNeg, 18 ClosedAdd, ClosedAddAssign, ClosedDiv, ClosedDivAssign, ClosedMul, ClosedMulAssign, ClosedNeg,
18 ClosedSub, ClosedSubAssign, 19 ClosedSub, ClosedSubAssign,
95 /// Trait for signed numeric types 96 /// Trait for signed numeric types
96 pub trait SignedNum: Num + num::Signed + std::ops::Neg<Output = Self> {} 97 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 {} 98 impl<U: Num + num::Signed + std::ops::Neg<Output = Self>> SignedNum for U {}
98 99
99 /// Trait for floating point numbers 100 /// Trait for floating point numbers
100 pub trait Float: SignedNum + std::fmt::LowerExp + num::Float /*+ From<Self::CompatibleSize>*/ { 101 pub trait Float:
102 SignedNum + std::fmt::LowerExp + num::Float + num_traits::float::TotalOrder
103 /*+ From<Self::CompatibleSize>*/
104 {
101 // An unsigned integer that can be used for indexing operations and 105 // An unsigned integer that can be used for indexing operations and
102 // converted to F without loss. 106 // converted to F without loss.
103 //type CompatibleSize : CompatibleUnsigned<Self>; 107 //type CompatibleSize : CompatibleUnsigned<Self>;
104 108
105 const PI: Self; 109 const PI: Self;

mercurial