2012-11-28 14:34:30 -06:00
|
|
|
use cmp::{Eq, Ord};
|
|
|
|
use num::from_int;
|
|
|
|
|
|
|
|
extern mod std;
|
|
|
|
use std::cmp::FuzzyEq;
|
|
|
|
|
2012-12-07 17:09:59 -06:00
|
|
|
pub trait NumExt: Num Eq Ord {}
|
2012-11-28 14:34:30 -06:00
|
|
|
|
2012-12-07 17:09:59 -06:00
|
|
|
pub trait FloatExt: NumExt FuzzyEq {}
|
2012-11-28 14:34:30 -06:00
|
|
|
|
|
|
|
fn greater_than_one<T:NumExt>(n: &T) -> bool { *n > from_int(1) }
|
|
|
|
fn greater_than_one_float<T:FloatExt>(n: &T) -> bool { *n > from_int(1) }
|
|
|
|
|
|
|
|
fn main() {}
|