You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/13 12:51:54 UTC
[GitHub] [arrow] SG011 commented on a diff in pull request #13568: ARROW-17036: [C++][Gandiva] Add sign Function
SG011 commented on code in PR #13568:
URL: https://github.com/apache/arrow/pull/13568#discussion_r920040644
##########
cpp/src/gandiva/precompiled/arithmetic_ops.cc:
##########
@@ -469,6 +469,28 @@ BITWISE_NOT(int64)
#undef DATE_TYPES
#undef NUMERIC_BOOL_DATE_TYPES
#undef NUMERIC_DATE_TYPES
+
+#define SIGN(TYPE) \
+ FORCE_INLINE \
+ gdv_##TYPE sign_##TYPE(gdv_##TYPE in1) { \
+ gdv_##TYPE out; \
+ if (in1 > 0) { \
+ out = static_cast<gdv_##TYPE>(1); \
+ } else if (in1 < 0) { \
+ out = static_cast<gdv_##TYPE>(-1); \
+ } else { \
+ out = static_cast<gdv_##TYPE>(0); \
Review Comment:
Ok
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org