impl BaseNum for integers

This commit is contained in:
arturo 2015-01-16 11:46:56 +01:00
parent 7b07d4d847
commit f82cb8002d
1 changed files with 11 additions and 1 deletions

View File

@ -8,7 +8,7 @@ use std::ops::{Add, Sub, Mul, Div, Neg, Rem, Index, IndexMut};
use traits::operations::{RMul, LMul, Axpy, Transpose, Inv, Absolute}; use traits::operations::{RMul, LMul, Axpy, Transpose, Inv, Absolute};
use traits::geometry::{Dot, Norm, Orig}; use traits::geometry::{Dot, Norm, Orig};
/// Basic isizeegral numeric trait. /// Basic integral numeric trait.
pub trait BaseNum: Copy + Zero + One + pub trait BaseNum: Copy + Zero + One +
Add<Self, Output = Self> + Sub<Self, Output = Self> + Add<Self, Output = Self> + Sub<Self, Output = Self> +
Mul<Self, Output = Self> + Div<Self, Output = Self> + Mul<Self, Output = Self> + Div<Self, Output = Self> +
@ -460,6 +460,16 @@ macro_rules! impl_base_float(
} }
); );
impl BaseNum for i8{}
impl BaseNum for i16{}
impl BaseNum for i32{}
impl BaseNum for i64{}
impl BaseNum for isize{}
impl BaseNum for u8{}
impl BaseNum for u16{}
impl BaseNum for u32{}
impl BaseNum for u64{}
impl BaseNum for usize{}
impl BaseNum for f32 { } impl BaseNum for f32 { }
impl BaseNum for f64 { } impl BaseNum for f64 { }