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

Function cos

numpy/array_api/_elementwise_functions.py:255–263  ·  view source on GitHub ↗

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

(x: Array, /)

Source from the content-addressed store, hash-verified

253
254
255def cos(x: Array, /) -> Array:
256 """
257 Array API compatible wrapper for :py:func:`np.cos <numpy.cos>`.
258
259 See its docstring for more information.
260 """
261 if x.dtype not in _floating_dtypes:
262 raise TypeError("Only floating-point dtypes are allowed in cos")
263 return Array._new(np.cos(x._array))
264
265
266def cosh(x: Array, /) -> Array:

Callers 7

legacy_vonmisesFunction · 0.85
random_vonmisesFunction · 0.85
blackmanFunction · 0.85
hanningFunction · 0.85
hammingFunction · 0.85
test_testUfuncs1Method · 0.85
test_basic_ufuncsMethod · 0.85

Calls 1

_newMethod · 0.80

Tested by 2

test_testUfuncs1Method · 0.68
test_basic_ufuncsMethod · 0.68