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

Function floor_divide

numpy/array_api/_elementwise_functions.py:339–350  ·  view source on GitHub ↗

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

(x1: Array, x2: Array, /)

Source from the content-addressed store, hash-verified

337
338
339def floor_divide(x1: Array, x2: Array, /) -> Array:
340 """
341 Array API compatible wrapper for :py:func:`np.floor_divide <numpy.floor_divide>`.
342
343 See its docstring for more information.
344 """
345 if x1.dtype not in _real_numeric_dtypes or x2.dtype not in _real_numeric_dtypes:
346 raise TypeError("Only real numeric dtypes are allowed in floor_divide")
347 # Call result type here just to raise on disallowed type combinations
348 _result_type(x1.dtype, x2.dtype)
349 x1, x2 = Array._normalize_two_args(x1, x2)
350 return Array._new(np.floor_divide(x1._array, x2._array))
351
352
353def greater(x1: Array, x2: Array, /) -> Array:

Callers 2

__floordiv__Method · 0.85
__rfloordiv__Method · 0.85

Calls 3

_result_typeFunction · 0.85
_normalize_two_argsMethod · 0.80
_newMethod · 0.80

Tested by

no test coverage detected