diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-07-26 16:16:28 -0700 |
|---|---|---|
| committer | Paul Stansifer <paul.stansifer@gmail.com> | 2012-07-26 16:16:28 -0700 |
| commit | 97422f0f0fdcbdd17a769fa9588e76b8bf8a5bdf (patch) | |
| tree | a91f89c585b54fccf34cd873d2488d2cb3c09909 /src/libstd/cmp.rs | |
| parent | 8209b2e9b383b9e38a09b1ec79c7b5691aeb5d22 (diff) | |
| parent | 44631722ff234241cb7100103320a402fe4fdfa9 (diff) | |
Merge branch 'incoming' of github.com:mozilla/rust
Diffstat (limited to 'src/libstd/cmp.rs')
| -rw-r--r-- | src/libstd/cmp.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/cmp.rs b/src/libstd/cmp.rs index a89148ecec9..f74cbba23ce 100644 --- a/src/libstd/cmp.rs +++ b/src/libstd/cmp.rs @@ -2,24 +2,24 @@ const fuzzy_epsilon: float = 1.0e-6; -iface fuzzy_eq { - fn fuzzy_eq(&&other: self) -> bool; +trait fuzzy_eq { + pure fn fuzzy_eq(&&other: self) -> bool; } impl fuzzy_eq of fuzzy_eq for float { - fn fuzzy_eq(&&other: float) -> bool { + pure fn fuzzy_eq(&&other: float) -> bool { ret float::abs(self - other) < fuzzy_epsilon; } } impl fuzzy_eq of fuzzy_eq for f32 { - fn fuzzy_eq(&&other: f32) -> bool { + pure fn fuzzy_eq(&&other: f32) -> bool { ret f32::abs(self - other) < (fuzzy_epsilon as f32); } } impl fuzzy_eq of fuzzy_eq for f64 { - fn fuzzy_eq(&&other: f64) -> bool { + pure fn fuzzy_eq(&&other: f64) -> bool { ret f64::abs(self - other) < (fuzzy_epsilon as f64); } } |
