Merge pull request #77 from arturoc/fix-basenum

impl BaseNum for integers.
This commit is contained in:
Sébastien Crozet 2015-01-17 22:54:08 +01:00
commit 800b8d7cd7
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::geometry::{Dot, Norm, Orig};
/// Basic isizeegral numeric trait.
/// Basic integral numeric trait.
pub trait BaseNum: Copy + Zero + One +
Add<Self, Output = Self> + Sub<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 f64 { }