projjal commented on a change in pull request #10516:
URL: https://github.com/apache/arrow/pull/10516#discussion_r659336341
##########
File path: cpp/src/gandiva/precompiled/extended_math_ops.cc
##########
@@ -367,4 +367,33 @@ gdv_float64 get_scale_multiplier(gdv_int32 scale) {
return power_float64_float64(10.0, scale);
}
+// convert input unsigned long to its binary representation
+void bin(uint64_t n, char* ret, int32_t* position) {
+ if (n > 1) {
+ bin(n / 2, ret, position);
+ }
+ ret[*position] = (n % 2) == 0 ? '0' : '1';
+ *position += 1;
+}
+
+// returns the binary representation of a given integer (e.g. 928 ->
1110100000)
+#define BIN_INTEGER(IN_TYPE)
\
+ FORCE_INLINE
\
+ const char* bin_##IN_TYPE(int64_t context, gdv_##IN_TYPE value, int32_t*
out_len) { \
Review comment:
It doesn't work with negative integers
--
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]