From c0866c51fe65b2cd3b10c6cea97f0464f018ff76 Mon Sep 17 00:00:00 2001 From: lwz9103 Date: Mon, 4 Nov 2024 15:09:08 +0800 Subject: [PATCH] tmp fix for round --- cpp-ch/local-engine/Functions/SparkFunctionRoundHalfUp.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp-ch/local-engine/Functions/SparkFunctionRoundHalfUp.h b/cpp-ch/local-engine/Functions/SparkFunctionRoundHalfUp.h index 432595e09140..3e219b51a695 100644 --- a/cpp-ch/local-engine/Functions/SparkFunctionRoundHalfUp.h +++ b/cpp-ch/local-engine/Functions/SparkFunctionRoundHalfUp.h @@ -111,7 +111,14 @@ class BaseFloatRoundingHalfUpComputation template static VectorType apply(VectorType val) { - return roundWithMode(val, mode); + if constexpr (std::is_same_v) + { + return std::roundf(val); + } + else + { + return std::round(val); + } } static VectorType prepare(size_t scale)