Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isnan and iszero for FLOAD and DOUBLE #7273

Closed
sarutak opened this issue Aug 12, 2023 · 0 comments · Fixed by #7274
Closed

Add isnan and iszero for FLOAD and DOUBLE #7273

sarutak opened this issue Aug 12, 2023 · 0 comments · Fixed by #7274
Labels
enhancement New feature or request

Comments

@sarutak
Copy link
Member

sarutak commented Aug 12, 2023

Is your feature request related to a problem or challenge?

In Datafusion, +NaN and -NaN are distinguished as well as +0.0 and -0.0.
For example, asin(10) returns NaN but 'inf'::DOUBLE / 'inf'::DOUBLE returns -NaN.
3.0 * 0 returns 0.0 but -3.0 * 0 returns -0.0.

So, users need to determine NaN and 0.0 like as follows.

SELECT ... WHERE x = 'NaN'::DOUBLE OR x = -'NaN'::DOUBLE;

To avoid such boilerplate code, I propose to add isnan and iszero.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

@sarutak sarutak added the enhancement New feature or request label Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant