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

Function floor

numpy/array_api/_elementwise_functions.py:325–336  ·  view source on GitHub ↗

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

(x: Array, /)

Source from the content-addressed store, hash-verified

323
324
325def floor(x: Array, /) -> Array:
326 """
327 Array API compatible wrapper for :py:func:`np.floor <numpy.floor>`.
328
329 See its docstring for more information.
330 """
331 if x.dtype not in _real_numeric_dtypes:
332 raise TypeError("Only real numeric dtypes are allowed in floor")
333 if x.dtype in _integer_dtypes:
334 # Note: The return dtype of floor is the same as the input
335 return x
336 return Array._new(np.floor(x._array))
337
338
339def floor_divide(x1: Array, x2: Array, /) -> Array:

Callers 12

testFloorMethod · 0.85
testFloorMethod · 0.85
testFloorMethod · 0.85
legacy_logseriesFunction · 0.85
hypergeometric_hruaFunction · 0.85
random_poisson_ptrsFunction · 0.85
random_binomial_btpeFunction · 0.85
random_logseriesFunction · 0.85
random_zipfFunction · 0.85
r_signFunction · 0.85

Calls 1

_newMethod · 0.80

Tested by 3

testFloorMethod · 0.68
testFloorMethod · 0.68
testFloorMethod · 0.68