Skip to content

floor division by zero doesn't match numpy #5132

Closed

Description

@ajpotts

I noticed the following discrepancy:

In [4]: x = ak.array([0,1])
In [5]: x//0
Out[5]: array([0 0])

In [6]: x.to_ndarray() //0
<ipython-input-6-a666e56723de>:1: RuntimeWarning: divide by zero encountered in floor_divide
  x.to_ndarray() //0

Activity

  1. drculhane commented on Dec 11, 2025

    @drculhane
    Contributor

    I have a fix for this, which throws a RuntimeWarning like numpy, comma however ... it causes all of the arctan2 tests to fail. Apparently those have been relying on our ignoring divide by zero errors.

  2. added a commit that references this issue on Feb 9, 2026
    677a811
  3. added a commit that references this issue on Feb 11, 2026
    681df08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions