MCPcopy Create free account
hub / github.com/numpy/numpy / remainder

Function remainder

numpy/array_api/_elementwise_functions.py:638–649  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.remainder `. See its docstring for more information.

(x1: Array, x2: Array, /)

Source from the content-addressed store, hash-verified

636
637
638def remainder(x1: Array, x2: Array, /) -> Array:
639 """
640 Array API compatible wrapper for :py:func:`np.remainder <numpy.remainder>`.
641
642 See its docstring for more information.
643 """
644 if x1.dtype not in _real_numeric_dtypes or x2.dtype not in _real_numeric_dtypes:
645 raise TypeError("Only real numeric dtypes are allowed in remainder")
646 # Call result type here just to raise on disallowed type combinations
647 _result_type(x1.dtype, x2.dtype)
648 x1, x2 = Array._normalize_two_args(x1, x2)
649 return Array._new(np.remainder(x1._array, x2._array))
650
651
652def round(x: Array, /) -> Array:

Callers 5

__mod__Method · 0.85
__rmod__Method · 0.85
__imod__Method · 0.85
__divmod__Method · 0.85
__rdivmod__Method · 0.85

Calls 3

_result_typeFunction · 0.85
_normalize_two_argsMethod · 0.80
_newMethod · 0.80

Tested by

no test coverage detected