diff --git a/CMakeLists.txt b/CMakeLists.txt index df01084..5f1374d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.19.1) +set(BLT_VERSION 0.19.2) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/math/math.h b/include/blt/math/math.h index 32041b2..c6588e3 100644 --- a/include/blt/math/math.h +++ b/include/blt/math/math.h @@ -77,10 +77,10 @@ namespace blt else { constexpr double multiplier = pow(10.0, decimal_places); - auto i_value = static_cast(value); - auto f_value = value - static_cast(i_value); + auto i_value = static_cast(value * multiplier); + auto f_value = (value * multiplier) - static_cast(i_value); if (f_value > 0) - return ((static_cast(i_value) * multiplier + 1) / multiplier); + return ((static_cast(i_value) + 1) / multiplier); else return static_cast(i_value); }