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

Method __float__

numpy/core/tests/test_umath.py:4081–4082  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4079 """ test implementations via __float__ """
4080 class C:
4081 def __float__(self):
4082 return -2.5
4083
4084 arr = np.array([C(), C()])
4085 assert_equal(np.floor(arr), [-3, -3])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected