Skip to content

BUG: isclose integer overflow #130

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 2 commits into from
Jan 29, 2025

Conversation

crusaderky
Copy link
Contributor

Fix crash in isclose, which with the default rtol happens when b.dtype is (u)int8 or (u)int16

Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

should this be documented (that the rtol is ignored in this case)? Perhaps we can also emit a warning if the user supplies an rtol that would be ignored?

@crusaderky
Copy link
Contributor Author

should this be documented (that the rtol is ignored in this case)? Perhaps we can also emit a warning if the user supplies an rtol that would be ignored?

It's not ignored. 65535 * 1e-5 < 1, so you can never have a False that flips to True because of it.

@lucascolley lucascolley added the bug Something isn't working label Jan 29, 2025
Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

makes sense, thanks!

@lucascolley lucascolley merged commit c23ac01 into data-apis:main Jan 29, 2025
10 checks passed
@crusaderky crusaderky deleted the isclose-overflow branch January 29, 2025 16:22
NeilGirdhar pushed a commit to NeilGirdhar/array-api-extra that referenced this pull request Feb 8, 2025
NeilGirdhar pushed a commit to NeilGirdhar/array-api-extra that referenced this pull request Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants