js8544 commented on code in PR #15208:
URL: https://github.com/apache/arrow/pull/15208#discussion_r1073060661


##########
cpp/src/gandiva/precompiled/arithmetic_ops_test.cc:
##########
@@ -629,6 +629,38 @@ TEST(TestArithmeticOps, TestSignIntFloatDouble) {
   EXPECT_EQ(sign_float64(-2147483647), -1.0);
 }
 
+TEST(TestArithmeticOps, TestAbsIntFloatDouble) {
+  // abs from int32
+  EXPECT_EQ(abs_int32(43), 43);
+  EXPECT_EQ(abs_int32(-54), 54);
+  EXPECT_EQ(abs_int32(63), 63);

Review Comment:
   nit: This case seems redundunt with the 43 case.



##########
cpp/src/gandiva/precompiled/arithmetic_ops.cc:
##########
@@ -494,6 +494,18 @@ SIGN(float32)
 SIGN(float64)
 
 #undef SIGN
+
+#define ABS(TYPE) \
+  FORCE_INLINE    \
+  gdv_##TYPE abs_##TYPE(gdv_##TYPE in1) { return 
static_cast<gdv_##TYPE>(std::abs(in1)); }

Review Comment:
   nit: Is this static_cast necessary?



-- 
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]

Reply via email to