Skip to content

Commit

Permalink
tmp fix for round
Browse files Browse the repository at this point in the history
  • Loading branch information
lwz9103 committed Nov 4, 2024
1 parent c40735b commit c0866c5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cpp-ch/local-engine/Functions/SparkFunctionRoundHalfUp.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ class BaseFloatRoundingHalfUpComputation<T, Vectorize::No>
template <RoundingMode mode>
static VectorType apply(VectorType val)
{
return roundWithMode(val, mode);
if constexpr (std::is_same_v<ScalarType, Float32>)
{
return std::roundf(val);
}
else
{
return std::round(val);
}
}

static VectorType prepare(size_t scale)
Expand Down

0 comments on commit c0866c5

Please sign in to comment.