mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[libaxx] add cmath and use cmath instead of math.h when required
Change-Id: Id839b17d33c69e2e002f370e553ff35246a1bc90
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user