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

BUG: Better report integer division overflow (backport) #22230

Merged

Commits on Sep 8, 2022

  1. BUG, SIMD: Handle overflow errors

    Overflows for remainder/divmod/fmod
    
    * If a types minimum value is divided by -1, an overflow will be raised
      and result will be set to minimum
    * Handle overflow and return 0 in case of mod related operations
    ganesh-k13 committed Sep 8, 2022
    Copy the full SHA
    d31240e View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    f35bc45 View commit details
    Browse the repository at this point in the history
  3. SIMD: Removed cvtozero

    Co-authored-by: Rafael Cardoso Fernandes Sousa <rafaelcfsousa@ibm.com>
    ganesh-k13 and rafaelcfsousa committed Sep 8, 2022
    Copy the full SHA
    edcbf93 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    55ec35e View commit details
    Browse the repository at this point in the history
  5. TST: Changed raise to warns

    * Changed `raise` to `warns` and test for `RuntimeWarning`
    * Added results check back
    ganesh-k13 committed Sep 8, 2022
    Copy the full SHA
    d61837d View commit details
    Browse the repository at this point in the history
  6. TST: Add additional tests for division-by-zero and integer overflow

    This introduces a helper to iterate through "interesting" array cases
    that could maybe be used in other places.  Keep the other test intact,
    it adds a check for mixed types (which is just casts currently, but
    cannot hurt) and is otherwise thorough.
    seberg authored and ganesh-k13 committed Sep 8, 2022
    Copy the full SHA
    e2a6580 View commit details
    Browse the repository at this point in the history
  7. MAINT: Remove nested NPY_UNLIKELY in division paths

    I am not certain the unlikely cases make much sense to begin with,
    but they are certainly not helpful within an unlikely block.
    seberg authored and ganesh-k13 committed Sep 8, 2022
    Copy the full SHA
    8a51635 View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    3c6a62f View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    c9ef357 View commit details
    Browse the repository at this point in the history
  10. BUG, SIMD: Handle division overflow errors

    * If a types minimum value is divided by -1, an overflow will be raised
      and result will be set to minimum
    ganesh-k13 committed Sep 8, 2022
    Copy the full SHA
    a463992 View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    e7f4199 View commit details
    Browse the repository at this point in the history
  12. Update numpy/core/src/umath/loops_arithmetic.dispatch.c.src

    Co-authored-by: Rafael Sousa <90851201+rafaelcfsousa@users.noreply.github.com>
    2 people authored and ganesh-k13 committed Sep 8, 2022
    Copy the full SHA
    8b36969 View commit details
    Browse the repository at this point in the history