You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "westonpace (via GitHub)" <gi...@apache.org> on 2023/02/01 22:06:28 UTC

[GitHub] [arrow] westonpace opened a new issue, #33990: [C++] I know NAN != NAN but shouldn't literal(NAN) == literal(NAN)?

westonpace opened a new issue, #33990:
URL: https://github.com/apache/arrow/issues/33990

   ### Describe the usage question you have. Please include as many useful details as  possible.
   
   
   I'm pretty sure of this but wanted a sanity test.  Also, should `literal(quiet_NAN) == literal(signaling_NAN)`? My intuition is "no".
   
   Or...more concretely...should these test cases pass?
   
   ```
     // This currently fails
     EXPECT_EQ(literal(std::numeric_limits<double>::quiet_NaN()),
               literal(std::numeric_limits<double>::quiet_NaN()));
     // These currently pass
     EXPECT_NE(literal(std::numeric_limits<double>::quiet_NaN()),
               literal(std::numeric_limits<double>::signaling_NaN()));
     EXPECT_NE(literal(std::numeric_limits<double>::quiet_NaN()),
               literal(std::numeric_limits<float>::quiet_NaN()));
   ```
   
   If the answer is "yes, those two expressions are equivalent" then I can fix it in #15180 .  I already have a fix but wanted to confirm my understanding.
   
   ### Component(s)
   
   C++


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] bkietz commented on issue #33990: [C++] I know NAN != NAN but shouldn't literal(NAN) == literal(NAN)?

Posted by "bkietz (via GitHub)" <gi...@apache.org>.
bkietz commented on issue #33990:
URL: https://github.com/apache/arrow/issues/33990#issuecomment-1412842913

   I think that we don't need to support signalling nans. Quiet nans may be produced by floating point expressions with invalid arguments, but signalling nans can only be produced explicitly- which is not functionality I think we'd find valuable. For our purposes, I don't think we need to check for signalling nans.
   
   I do think that `literal(nan) == literal(nan)` should be true- as you say those two expressions are equivalent. I think just to disambiguate the situation the unit test should also assert that `equal(literal(nan), literal(nan))` evaluates to false and clarify why that difference exists with a comment


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


[GitHub] [arrow] jorisvandenbossche closed issue #33990: [C++] I know NAN != NAN but shouldn't literal(NAN) == literal(NAN)?

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche closed issue #33990: [C++] I know NAN != NAN but shouldn't literal(NAN) == literal(NAN)?
URL: https://github.com/apache/arrow/issues/33990


-- 
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: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] westonpace commented on issue #33990: [C++] I know NAN != NAN but shouldn't literal(NAN) == literal(NAN)?

Posted by "westonpace (via GitHub)" <gi...@apache.org>.
westonpace commented on issue #33990:
URL: https://github.com/apache/arrow/issues/33990#issuecomment-1412832487

   Ah, I can use `issignaling` which is in `<cmath>` but has no c++ equivalent.


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


[GitHub] [arrow] westonpace commented on issue #33990: [C++] I know NAN != NAN but shouldn't literal(NAN) == literal(NAN)?

Posted by "westonpace (via GitHub)" <gi...@apache.org>.
westonpace commented on issue #33990:
URL: https://github.com/apache/arrow/issues/33990#issuecomment-1412824709

   Actually, I can't find a good way to test if a NaN is a quiet nan or a signalling NaN so now I'm tempted to say literal(quiet_NaN) == literal(signal_NaN) as well.


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


[GitHub] [arrow] jorisvandenbossche commented on issue #33990: [C++] I know NAN != NAN but shouldn't literal(NAN) == literal(NAN)?

Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on issue #33990:
URL: https://github.com/apache/arrow/issues/33990#issuecomment-1433075908

   This was closed by https://github.com/apache/arrow/pull/15180


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