From 24c9dce8254a7f87d10f280e801f4a6e7ab7310d Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 5 Feb 2020 20:59:13 -0800 Subject: [PATCH] Remove include math.h (#6373) Summary: We see some odd errors complaining math. However, it doesn't seem that it is needed to be included. Remove the include of math.h. Just removing it from db_bench doesn't seem to break anything. Replacing sqrt from std::sqrt seems to work for histogram.cc Pull Request resolved: https://github.com/facebook/rocksdb/pull/6373 Test Plan: Watch Travis and appveyor to run. Differential Revision: D19730068 fbshipit-source-id: d3ad41defcdd9f51c2da1a3673fb258f5dfacf47 --- monitoring/histogram.cc | 4 ++-- tools/db_bench_tool.cc | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/monitoring/histogram.cc b/monitoring/histogram.cc index 4449ade64..3fb30e0d7 100644 --- a/monitoring/histogram.cc +++ b/monitoring/histogram.cc @@ -9,10 +9,10 @@ #include "monitoring/histogram.h" -#include #include #include #include +#include #include "port/port.h" #include "util/cast_util.h" @@ -177,7 +177,7 @@ double HistogramStat::StandardDeviation() const { double variance = static_cast(cur_sum_squares * cur_num - cur_sum * cur_sum) / static_cast(cur_num * cur_num); - return sqrt(variance); + return std::sqrt(variance); } std::string HistogramStat::ToString() const { uint64_t cur_num = num(); diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 383a12062..f0c447262 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -16,7 +16,6 @@ #include #endif #include -#include #include #include #include