diff --git a/src/FixedPoints/Utils.h b/src/FixedPoints/Utils.h index 14458f0..f039af0 100644 --- a/src/FixedPoints/Utils.h +++ b/src/FixedPoints/Utils.h @@ -127,7 +127,7 @@ template< unsigned Integer, unsigned Fraction > constexpr UFixed roundFixed(const UFixed & value) { using OutputType = UFixed; - return ((value.getFraction() >= OutputType(0.5).getFraction()) != 0) ? ceilFixed(value) : floorFixed(value); + return (value.getFraction() >= OutputType(0.5).getFraction()) ? ceilFixed(value) : floorFixed(value); } template< unsigned Integer, unsigned Fraction > @@ -136,8 +136,8 @@ constexpr SFixed roundFixed(const SFixed & using OutputType = SFixed; return signbitFixed(value) - ? ((value.getFraction() <= OutputType(0.5).getFraction()) != 0) ? floorFixed(value) : ceilFixed(value) - : ((value.getFraction() >= OutputType(0.5).getFraction()) != 0) ? ceilFixed(value) : floorFixed(value); + ? (value.getFraction() <= OutputType(0.5).getFraction()) ? floorFixed(value) : ceilFixed(value) + : (value.getFraction() >= OutputType(0.5).getFraction()) ? ceilFixed(value) : floorFixed(value); } template< unsigned Integer, unsigned Fraction >