2012-11-15 02:23:39 +00:00
|
|
|
use core::cmp::{Eq, Ord};
|
|
|
|
|
|
|
|
use std::cmp::FuzzyEq;
|
|
|
|
|
|
|
|
use num::cast::*;
|
|
|
|
use num::consts::*;
|
2012-11-20 02:57:08 +00:00
|
|
|
use num::default_eq::*;
|
2012-11-15 02:23:39 +00:00
|
|
|
|
|
|
|
|
2012-11-28 04:18:29 +00:00
|
|
|
pub trait NumExt: Copy, Eq, Num, NumCast, Ord {}
|
2012-11-20 02:57:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
pub trait UnSignedExt: NumExt {}
|
2012-11-15 02:23:39 +00:00
|
|
|
|
|
|
|
pub impl u8: UnSignedExt {}
|
|
|
|
pub impl u16: UnSignedExt {}
|
|
|
|
pub impl u32: UnSignedExt {}
|
|
|
|
pub impl u64: UnSignedExt {}
|
|
|
|
pub impl uint: UnSignedExt {}
|
|
|
|
|
|
|
|
|
2012-11-20 02:57:08 +00:00
|
|
|
pub trait SignedExt: NumExt {}
|
2012-11-15 02:23:39 +00:00
|
|
|
|
|
|
|
pub impl i8: SignedExt {}
|
|
|
|
pub impl i16: SignedExt {}
|
|
|
|
pub impl i32: SignedExt {}
|
|
|
|
pub impl i64: SignedExt {}
|
|
|
|
pub impl int: SignedExt {}
|
|
|
|
|
|
|
|
pub impl f32: SignedExt {}
|
|
|
|
pub impl f64: SignedExt {}
|
|
|
|
pub impl float: SignedExt {}
|
|
|
|
|
|
|
|
|
2012-11-20 02:57:08 +00:00
|
|
|
pub trait IntegerExt: NumExt, IntConsts {}
|
2012-11-15 02:23:39 +00:00
|
|
|
|
|
|
|
pub impl u8: IntegerExt {}
|
|
|
|
pub impl u16: IntegerExt {}
|
|
|
|
pub impl u32: IntegerExt {}
|
|
|
|
pub impl u64: IntegerExt {}
|
|
|
|
pub impl uint: IntegerExt {}
|
|
|
|
|
|
|
|
pub impl i8: IntegerExt {}
|
|
|
|
pub impl i16: IntegerExt {}
|
|
|
|
pub impl i32: IntegerExt {}
|
|
|
|
pub impl i64: IntegerExt {}
|
|
|
|
pub impl int: IntegerExt {}
|
|
|
|
|
|
|
|
|
2012-11-20 02:57:08 +00:00
|
|
|
pub trait FloatExt: NumExt, FloatConsts, FuzzyEq {}
|
2012-11-15 02:23:39 +00:00
|
|
|
|
|
|
|
pub impl f32: FloatExt {}
|
|
|
|
pub impl f64: FloatExt {}
|
|
|
|
pub impl float: FloatExt {}
|