summaryrefslogtreecommitdiffstats
path: root/src/util/math.h
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2017-08-28 23:39:46 +0200
committerDaniel Schürmann <daschuer@mixxx.org>2017-09-28 00:18:59 +0200
commit35b590fda957b27373a464d8205ec07d49d5a3f8 (patch)
treeba6a7398cce84871f0f9d58517ab9be9861d079d /src/util/math.h
parentad1ff9ebe8c8344ef0c50a3523786f16d866d296 (diff)
Remove casting in roundToFraction
Diffstat (limited to 'src/util/math.h')
-rw-r--r--src/util/math.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/math.h b/src/util/math.h
index aa9cd54717..792209b4f0 100644
--- a/src/util/math.h
+++ b/src/util/math.h
@@ -68,8 +68,8 @@ inline int roundUpToPowerOf2(int v) {
inline double roundToFraction(double value, int denominator) {
int wholePart = value;
double fractionPart = value - wholePart;
- int numerator = std::lround(fractionPart * denominator);
- return wholePart + (double) numerator / (double) denominator;
+ double numerator = std::round(fractionPart * denominator);
+ return wholePart + numerator / denominator;
}
template <typename T>