You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2019/03/28 21:29:00 UTC
[jira] [Created] (ARROW-5059) [C++][Gandiva] cbrt_* floating point
tests can fail due to exact comparisons
Wes McKinney created ARROW-5059:
-----------------------------------
Summary: [C++][Gandiva] cbrt_* floating point tests can fail due to exact comparisons
Key: ARROW-5059
URL: https://issues.apache.org/jira/browse/ARROW-5059
Project: Apache Arrow
Issue Type: Bug
Components: C++ - Gandiva
Reporter: Wes McKinney
Fix For: 0.14.0
I observed this when running the release verification on Ubuntu 14.04
{code}
[ RUN ] TestExtendedMathOps.TestCbrt
/tmp/arrow-0.13.0.WeWDY/apache-arrow-0.13.0/cpp/src/gandiva/precompiled/extended_math_ops_test.cc:27: Failure
Expected: cbrt_float32(27)
Which is: 3
To be equal to: 3
/tmp/arrow-0.13.0.WeWDY/apache-arrow-0.13.0/cpp/src/gandiva/precompiled/extended_math_ops_test.cc:28: Failure
Expected: cbrt_float64(27)
Which is: 3
To be equal to: 3
/tmp/arrow-0.13.0.WeWDY/apache-arrow-0.13.0/cpp/src/gandiva/precompiled/extended_math_ops_test.cc:29: Failure
Expected: cbrt_float64(-27)
Which is: -3
To be equal to: -3
{code}
The tests in question:
{code}
TEST(TestExtendedMathOps, TestCbrt) {
EXPECT_EQ(cbrt_int32(27), 3);
EXPECT_EQ(cbrt_int64(27), 3);
EXPECT_EQ(cbrt_float32(27), 3);
EXPECT_EQ(cbrt_float64(27), 3);
EXPECT_EQ(cbrt_float64(-27), -3);
EXPECT_EQ(cbrt_float32(15.625), 2.5);
EXPECT_EQ(cbrt_float64(15.625), 2.5);
}
{code}
I believe that assertions involving floating point equality need to be approximate (up to a typical epsilon like 1E-14/1E-15)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)