diff --git a/fixedpoint/fixedpoint.h b/fixedpoint/fixedpoint.h index 56e95c0..5305166 100644 --- a/fixedpoint/fixedpoint.h +++ b/fixedpoint/fixedpoint.h @@ -527,7 +527,7 @@ class FixedPoint { const double min_bound = static_cast(ScalarRawMin()); const double max_bound = static_cast(ScalarRawMax()); return FromScalarRaw(static_cast(std::min( - std::max(round(x * static_cast(1ll << kFractionalBits)), + std::max(std::round(x * static_cast(1ll << kFractionalBits)), min_bound), max_bound))); }