diff --git a/Software/math/PrismatikMath.cpp b/Software/math/PrismatikMath.cpp index dcdb7efa..778923cd 100644 --- a/Software/math/PrismatikMath.cpp +++ b/Software/math/PrismatikMath.cpp @@ -30,9 +30,9 @@ namespace PrismatikMath { //Observer= 2°, Illuminant= D65 - const float refX = 95.047; - const float refY = 100.000; - const float refZ = 108.883; + const float refX = 95.047f; + const float refY = 100.000f; + const float refZ = 108.883f; template T withinRange(A x, T min, T max) diff --git a/Software/math/include/PrismatikMath.hpp b/Software/math/include/PrismatikMath.hpp index cb280bfc..7a6622f2 100644 --- a/Software/math/include/PrismatikMath.hpp +++ b/Software/math/include/PrismatikMath.hpp @@ -63,5 +63,9 @@ namespace PrismatikMath return qrand() % val; } + inline double round(double number) + { + return number < 0.0 ? std::ceil(number - 0.5) : std::floor(number + 0.5); + } }