about summary refs log tree commit diff
path: root/src/libtest
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-14 13:41:36 -0700
committerbors <bors@rust-lang.org>2014-03-14 13:41:36 -0700
commit42fc32f293eb7de7139f058fa06f580a503b87b5 (patch)
tree3e59bee58501bd7e74f7ca03c887f78eef81b6ab /src/libtest
parente99d523707c8058383e7a551e49d59ce622d5765 (diff)
parent4e1c2158f29fbb6c2bdb4d50f1fdc6a30685bc3c (diff)
downloadrust-42fc32f293eb7de7139f058fa06f580a503b87b5.tar.gz
rust-42fc32f293eb7de7139f058fa06f580a503b87b5.zip
auto merge of #12869 : thestinger/rust/cmp, r=brson
The `Float` trait provides correct `min` and `max` methods on floating
point types, providing a consistent result regardless of the order the
parameters are passed.

These generic functions do not take the necessary performance hit to
correctly support a partial order, so the true requirement should be
given as a type bound.

Closes #12712
Diffstat (limited to 'src/libtest')
-rw-r--r--src/libtest/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index a3e68591d50..b4561b3075d 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -1070,7 +1070,7 @@ impl MetricMap {
                     if delta.abs() <= noise {
                         LikelyNoise
                     } else {
-                        let pct = delta.abs() / cmp::max(vold.value, f64::EPSILON) * 100.0;
+                        let pct = delta.abs() / vold.value.max(f64::EPSILON) * 100.0;
                         if vold.noise < 0.0 {
                             // When 'noise' is negative, it means we want
                             // to see deltas that go up over time, and can