[core] don't use floating point versions of pow/log

GLIBC 2.27 added new versioned symbols of powf and logf, while the double versions of pow and log remained stable.
Prefer the double version to avoid introducing a dependency on a newer version of GLIBC than strictly necessary.
See https://lists.gnu.org/archive/html/info-gnu/2018-02/msg00000.html
This commit is contained in:
Konstantin Käfer
2018-05-29 14:07:32 +02:00
parent d232a7a6f3
commit d66251234d
14 changed files with 20 additions and 31 deletions

View File

@@ -270,7 +270,7 @@ double TransformState::zoomScale(double zoom) const {
}
double TransformState::scaleZoom(double s) const {
return util::log2(s);
return ::log2(s);
}
ScreenCoordinate TransformState::latLngToScreenCoordinate(const LatLng& latLng) const {
@@ -280,7 +280,7 @@ ScreenCoordinate TransformState::latLngToScreenCoordinate(const LatLng& latLng)
mat4 mat = coordinatePointMatrix(getZoom());
vec4 p;
Point<double> pt = Projection::project(latLng, scale) / double(util::tileSize);
Point<double> pt = Projection::project(latLng, scale) / util::tileSize;
vec4 c = {{ pt.x, pt.y, 0, 1 }};
matrix::transformMat4(p, c, mat);
return { p[0] / p[3], size.height - p[1] / p[3] };
@@ -427,7 +427,7 @@ float TransformState::maxPitchScaleFactor() const {
}
auto latLng = screenCoordinateToLatLng({ 0, static_cast<float>(getSize().height) });
mat4 mat = coordinatePointMatrix(getZoom());
Point<double> pt = Projection::project(latLng, scale) / double(util::tileSize);
Point<double> pt = Projection::project(latLng, scale) / util::tileSize;
vec4 p = {{ pt.x, pt.y, 0, 1 }};
vec4 topPoint;
matrix::transformMat4(topPoint, p, mat);