pprudhvi commented on a change in pull request #8467:
URL: https://github.com/apache/arrow/pull/8467#discussion_r506181132
##########
File path: cpp/src/gandiva/precompiled/extended_math_ops.cc
##########
@@ -112,8 +112,24 @@ LOG_WITH_BASE(float64, float64, float64)
POWER(float64, float64, float64)
-// round
-#define ROUND_DECIMAL(TYPE) \
+FORCE_INLINE
+gdv_int32 round_int32(gdv_int32 num) { return num; }
+
+FORCE_INLINE
+gdv_int64 round_int64(gdv_int64 num) { return num; }
+
+// one-argument round
+#define ROUND_DECIMAL_ONE_ARG(TYPE) \
+ FORCE_INLINE \
+ gdv_##TYPE round_##TYPE(gdv_##TYPE num) { \
+ return static_cast<gdv_##TYPE>(trunc(num + ((num > 0) ? 0.5 : -0.5))); \
+ }
+
+ROUND_DECIMAL_ONE_ARG(float32)
Review comment:
let this be just 'round_decimal'
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]