[libaxx] add cmath and use cmath instead of math.h when required

Change-Id: Id839b17d33c69e2e002f370e553ff35246a1bc90
This commit is contained in:
Émilie Feral
2017-08-07 11:47:47 +02:00
parent 9f0bbe0e75
commit 1964d61fdc
111 changed files with 377 additions and 303 deletions

View File

@@ -1,5 +1,5 @@
#include "curve_view_range.h"
#include <math.h>
#include <cmath>
#include <ion.h>
#include <assert.h>
#include <stddef.h>
@@ -31,12 +31,12 @@ float CurveViewRange::computeGridUnit(Axis axis, float min, float max) {
float units[3] = {k_smallGridUnitMantissa, k_mediumGridUnitMantissa, k_largeGridUnitMantissa};
for (int k = 0; k < 3; k++) {
float unit = units[k];
if (floorf(log10f(d/(unit*maxNumberOfUnits))) != floorf(log10f(d/(unit*minNumberOfUnits)))) {
b = floorf(log10f(d/(unit*minNumberOfUnits)));
if (std::floor(std::log10(d/(unit*maxNumberOfUnits))) != std::floor(std::log10(d/(unit*minNumberOfUnits)))) {
b = std::floor(std::log10(d/(unit*minNumberOfUnits)));
a = unit;
}
}
return a*powf(10,b);
return a*std::pow(10.0f,b);
}
}