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 2020/10/08 12:11:58 UTC

[GitHub] [arrow] vvellanki commented on a change in pull request #8398: ARROW-10234: [C++][Gandiva] Fix logic of round() for floats/decimals in Gandiva

vvellanki commented on a change in pull request #8398:
URL: https://github.com/apache/arrow/pull/8398#discussion_r501670246



##########
File path: cpp/src/gandiva/precompiled/extended_math_ops_test.cc
##########
@@ -93,6 +93,9 @@ TEST(TestExtendedMathOps, TestRoundDecimal) {
   EXPECT_FLOAT_EQ(round_float32_int32(-1234.4567f, 3), -1234.457f);
   EXPECT_FLOAT_EQ(round_float32_int32(-1234.4567f, -3), -1000);
   EXPECT_FLOAT_EQ(round_float32_int32(1234.4567f, 0), 1234);
+  EXPECT_FLOAT_EQ(round_float32_int32(static_cast<float>(1.55), 1), 1.5f);

Review comment:
       Please add an explicit test for round_float32_int32(1.5499999523162842f, 1) = 1.5f
   
   The test here is confusing - it relies on people knowing that (float)1.55 = 1.5499999523162842




----------------------------------------------------------------
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:
users@infra.apache.org