Skip to content

NaN tests + Workflow + README fixes #114

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

Merged
merged 7 commits into from
Jul 4, 2025
Merged

Conversation

SwayamInSync
Copy link
Collaborator

This PR contributes as follows:

  • Sleef comparison operators with NaN return false on equal and not equal comparisons (unlike the proposition NaN-wikipedia I earlier found in IEEE-754 that says nan != nan should return true) hence removing that particular test
  • Updated the README file with latest instructions to follow for installation
  • Modifies workflow to publish on PyPI rather than Test-PyPI

@juntyr
Copy link
Contributor

juntyr commented Jul 3, 2025

* Sleef comparison operators with NaN return false on equal and not equal comparisons (unlike the proposition [NaN-wikipedia](https://en.wikipedia.org/wiki/NaN#Comparison_with_NaN) I earlier found in IEEE-754 that says `nan != nan` should return true) hence removing that particular test

It is critical that NaN != NaN returns True, as testing for NaNs is often defined by this check. Since sleef comparison doesn't return True for NaN != NaN yet, this should be fixed in the sleef wrapper.

@SwayamInSync
Copy link
Collaborator Author

* Sleef comparison operators with NaN return false on equal and not equal comparisons (unlike the proposition [NaN-wikipedia](https://en.wikipedia.org/wiki/NaN#Comparison_with_NaN) I earlier found in IEEE-754 that says `nan != nan` should return true) hence removing that particular test

It is critical that NaN != NaN returns True, as testing for NaNs is often defined by this check. Since sleef comparison doesn't return True for NaN != NaN yet, this should be fixed in the sleef wrapper.

Yes for now this won't be an issue as, there is an API Sleef_iunordq1_purec to check the "unordered" condition like NaN.
which internally compares the input value as is_not_finite(x) & !is_inf(x)

@juntyr
Copy link
Contributor

juntyr commented Jul 4, 2025

I've opened #115 to fix the NaN comparisons and add extra tests for them

Copy link
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think two of the changes to the readme should be reverted

@SwayamInSync
Copy link
Collaborator Author

Just noticed window's build time is increased to 10 minutes but this seems to work

@ngoldbaum ngoldbaum merged commit 53ccf00 into numpy:main Jul 4, 2025
6 checks passed
@ngoldbaum
Copy link
Member

Thanks @SwayamInSync!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants