Skip to content

Commit b081f59

Browse files
committed
Convert fuzzy_epsilon constant to upper case and make public
1 parent 801f322 commit b081f59

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libstd/cmp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use core::f32;
1515
use core::f64;
1616
use core::float;
1717

18-
const fuzzy_epsilon: float = 1.0e-6;
18+
pub const FUZZY_EPSILON: float = 1.0e-6;
1919

2020
pub trait FuzzyEq {
2121
pure fn fuzzy_eq(&self, other: &Self) -> bool;
@@ -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)