Skip to content

fix FuzzyEq #4676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 29, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libstd/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub trait FuzzyEq {

impl float: FuzzyEq {
pure fn fuzzy_eq(&self, other: &float) -> bool {
self.fuzzy_eq_eps(other, fuzzy_epsilon)
self.fuzzy_eq_eps(other, &fuzzy_epsilon)
}

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

impl f32: FuzzyEq {
pure fn fuzzy_eq(&self, other: &f32) -> bool {
self.fuzzy_eq_eps(other, fuzzy_epsilon as f32)
self.fuzzy_eq_eps(other, &(fuzzy_epsilon as f32))
}

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

impl f64: FuzzyEq {
pure fn fuzzy_eq(&self, other: &f64) -> bool {
self.fuzzy_eq_eps(other, fuzzy_epsilon as f64)
self.fuzzy_eq_eps(other, &(fuzzy_epsilon as f64))
}

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