diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2016-06-27 13:09:02 +0200 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2016-06-27 13:09:02 +0200 |
commit | aeda392c49f5311addead1795a625ac0ec3eba40 (patch) | |
tree | fe67b490f103609dcf1bed302edb5efc57df7957 /fbench | |
parent | 430637ddfce58b968ce6ad0d8d3934fbc4f6c1f8 (diff) |
use cmath
* avoid using #include <math.h>
* add std:: namespace prefix when calling <cmath> functions
Diffstat (limited to 'fbench')
-rw-r--r-- | fbench/src/util/clientstatus.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fbench/src/util/clientstatus.cpp b/fbench/src/util/clientstatus.cpp index 6c117d7e0e6..e6decc42c09 100644 --- a/fbench/src/util/clientstatus.cpp +++ b/fbench/src/util/clientstatus.cpp @@ -1,7 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "clientstatus.h" #include <string.h> -#include <math.h> +#include <cmath> + ClientStatus::ClientStatus() : _error(false), @@ -123,9 +124,9 @@ ClientStatus::GetPercentile(double percent) if (percent > 100.0) percent = 100.0; double target = ((double)(_requestCnt - 1)) * (percent / 100.0); - long t1 = (long)floor(target); - long t2 = (long)ceil(target); - double k = ceil(target) - target; + long t1 = (long)std::floor(target); + long t2 = (long)std::ceil(target); + double k = std::ceil(target) - target; int i1 = 0; int i2 = 0; long cnt = 0; |