From 0d794254be5713ffa8a2fdbcc5b0884af02247d6 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 14 Dec 2017 03:00:31 +0100 Subject: [PATCH] util-math: Fix MSVC 2013 errors --- source/util-math.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/util-math.h b/source/util-math.h index a2e36fb..3fcfd50 100644 --- a/source/util-math.h +++ b/source/util-math.h @@ -33,9 +33,9 @@ inline double_t Gaussian1D(double_t x, double_t o) { } inline size_t GetNearestPowerOfTwoAbove(size_t v) { - return 1 << size_t(ceil(log10(v) / log10(2))); + return 1ull << size_t(ceil(log10(double(v)) / log10(2.0))); } inline size_t GetNearestPowerOfTwoBelow(size_t v) { - return 1 << size_t(floor(log10(v) / log10(2))); + return 1ull << size_t(floor(log10(double(v)) / log10(2.0))); }