From fbd9023b3cfe2a5b1d2312dd993477f34bc83d88 Mon Sep 17 00:00:00 2001 From: Lukasz Wojcik Date: Mon, 1 Dec 2025 10:26:12 +0100 Subject: [PATCH] Use explicit call to std math. Using the lib in embedded environments, causes issues with compilation using ARM embedded toolchains. The call to round() is being resolved as a call to lround() and hence breaks the build, as std::max() expects two arguments of type double. Making it a explicit call to std::round() fixes the issue. --- fixedpoint/fixedpoint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))); }