aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/approx
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2016-06-27 13:08:34 +0200
committerArne Juul <arnej@yahoo-inc.com>2016-06-27 13:08:34 +0200
commit430637ddfce58b968ce6ad0d8d3934fbc4f6c1f8 (patch)
treeff14773eb611f327acef49e0e1ad51b0c9c4173f /vespalib/src/tests/approx
parente54f27e524e18ea2bf0290699814c5fe40b1e8d4 (diff)
use cmath
* avoid using #include <math.h> * add std:: namespace prefix when calling <cmath> functions
Diffstat (limited to 'vespalib/src/tests/approx')
-rw-r--r--vespalib/src/tests/approx/approx_test.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/vespalib/src/tests/approx/approx_test.cpp b/vespalib/src/tests/approx/approx_test.cpp
index 8181669db60..d9e89ffff7a 100644
--- a/vespalib/src/tests/approx/approx_test.cpp
+++ b/vespalib/src/tests/approx/approx_test.cpp
@@ -3,6 +3,7 @@
#include <vespa/vespalib/util/approx.h>
#include <limits>
#include <cfloat>
+#include <cmath>
#include <vespa/vespalib/util/stringfmt.h>
using vespalib::approx_equal;
@@ -85,7 +86,7 @@ TEST("require that numbers with slightly larger differences are not approximatel
TEST("require that specific numbers with almost 2 ULP differences are approximately equal") {
double base = 0.25111f;
- double epsilon = nextafterf(base, 1.0) - base;
+ double epsilon = std::nextafterf(base, 1.0) - base;
double larger = base + epsilon*1.499;
double smaller = base - epsilon*0.499;
EXPECT_TRUE(approx_equal(larger, smaller));