Closed
Description
The __floordiv__
and __mod__
operators do not raise an exception for zero division with np.errstate(divide='raise')
, instead replacing those instances with nan
as if errstate
is in the default state.
import numpy as np
x = np.ones((3, 3))
y = np.zeros((3, 3))
with np.errstate(divide='raise'):
fdiv = x // y # expecting exception
mod = x % y # expecting exception
Numpy: 1.17.3