github-actions[bot] commented on code in PR #15154:
URL: https://github.com/apache/doris/pull/15154#discussion_r1053707134
##########
be/src/exprs/math_functions.cpp:
##########
@@ -222,6 +222,22 @@ BigIntVal MathFunctions::round(FunctionContext* ctx, const
DoubleVal& v) {
return BigIntVal(static_cast<int64_t>(v.val + ((v.val < 0) ? -0.5 : 0.5)));
}
+BigIntVal MathFunctions::round_bankers(FunctionContext* ctx, const DoubleVal&
v) {
+ double fraction = v.val - std::floor(v.val);
+ if (fraction < 0.5) {
+ return BigIntVal(static_cast<int64_t>(std::floor(v.val)));
+ } else if (fraction > 0.5) {
+ return BigIntVal(static_cast<int64_t>(std::ceil(v.val)));
+ } else {
+ auto lower = floor(v.val);
Review Comment:
warning: too few arguments to function call, expected 2, have 1; did you
mean '::floor'? [clang-diagnostic-error]
```suggestion
auto lower = ::floor(v.val);
```
**/usr/include/x86_64-linux-gnu/bits/mathcalls.h:164:** '::floor' declared
here
```cpp
__MATHCALLX (floor,, (_Mdouble_ __x), (__const__));
^
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]