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

NaN inverse raises unexpected ZeroDivisionError #9146

Closed
2 tasks done
Ranfir opened this issue Aug 22, 2023 · 2 comments
Closed
2 tasks done

NaN inverse raises unexpected ZeroDivisionError #9146

Ranfir opened this issue Aug 22, 2023 · 2 comments
Labels
needtriage stale Marker label for stale issues.

Comments

@Ranfir
Copy link

Ranfir commented Aug 22, 2023

Reporting a bug

  • I have tried using the latest released version of Numba (most recent is
    visible in the change log (https://github.com/numba/numba/blob/main/CHANGE_LOG).
  • I have included a self contained code sample to reproduce the problem.
    i.e. it's possible to run as 'python bug.py'.
from numba import njit
import numpy as np

@njit
def foo(x):
    return x**-1

foo(np.array([np.nan])) # array([nan])
foo(np.array([np.nan], np.float32)) # ZeroDivisionError: division by zero

Tested under python 3.10.9. This behavior appears in 0.57.1, but is not present in 0.56.4. Setting fastmath=False per #8889 doesn't change this behavior.

@stuartarchibald
Copy link
Contributor

Thanks for the report. Unfortunately this doesn't seem to reproduce for me, I've tested it on a couple of systems with different configurations. There are some issues with pow as noted in #7012, it might be another issue in the implementation that moving to LLVM 14 has highlighted.

@github-actions
Copy link

This issue is marked as stale as it has had no activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with any updates and confirm that this issue still needs to be addressed.

@github-actions github-actions bot added the stale Marker label for stale issues. label Oct 13, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needtriage stale Marker label for stale issues.
Projects
None yet
Development

No branches or pull requests

2 participants