Skip to content

Commit a80a65b

Browse files
committed
Merge pull request #4676 from thestinger/fuzzy
fix FuzzyEq
2 parents 95b892c + 1aa9fdf commit a80a65b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libstd/cmp.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub trait FuzzyEq {
2424

2525
impl float: FuzzyEq {
2626
pure fn fuzzy_eq(&self, other: &float) -> bool {
27-
self.fuzzy_eq_eps(other, fuzzy_epsilon)
27+
self.fuzzy_eq_eps(other, &fuzzy_epsilon)
2828
}
2929

3030
pure fn fuzzy_eq_eps(&self, other: &float, epsilon: &float) -> bool {
@@ -34,7 +34,7 @@ impl float: FuzzyEq {
3434

3535
impl f32: FuzzyEq {
3636
pure fn fuzzy_eq(&self, other: &f32) -> bool {
37-
self.fuzzy_eq_eps(other, fuzzy_epsilon as f32)
37+
self.fuzzy_eq_eps(other, &(fuzzy_epsilon as f32))
3838
}
3939

4040
pure fn fuzzy_eq_eps(&self, other: &f32, epsilon: &f32) -> bool {
@@ -44,7 +44,7 @@ impl f32: FuzzyEq {
4444

4545
impl f64: FuzzyEq {
4646
pure fn fuzzy_eq(&self, other: &f64) -> bool {
47-
self.fuzzy_eq_eps(other, fuzzy_epsilon as f64)
47+
self.fuzzy_eq_eps(other, &(fuzzy_epsilon as f64))
4848
}
4949

5050
pure fn fuzzy_eq_eps(&self, other: &f64, epsilon: &f64) -> bool {

0 commit comments

Comments
 (0)