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

Class _DomainTan

numpy/ma/core.py:822–837  ·  view source on GitHub ↗

Define a valid interval for the `tan` function, so that: ``domain_tan(eps) = True`` where ``abs(cos(x)) < eps``

Source from the content-addressed store, hash-verified

820
821
822class _DomainTan:
823 """
824 Define a valid interval for the `tan` function, so that:
825
826 ``domain_tan(eps) = True`` where ``abs(cos(x)) < eps``
827
828 """
829
830 def __init__(self, eps):
831 "domain_tan(eps) = true where abs(cos(x)) < eps)"
832 self.eps = eps
833
834 def __call__(self, x):
835 "Executes the call behavior."
836 with np.errstate(invalid='ignore'):
837 return umath.less(umath.absolute(umath.cos(x)), self.eps)
838
839
840class _DomainSafeDivide:

Callers 1

core.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected