Home
last modified time | relevance | path

Searched refs:abs_tol (Results 1 - 7 of 7) sorted by relevance

/third_party/python/Modules/clinic/
H A Dmathmodule.c.h549 "isclose($module, /, a, b, *, rel_tol=1e-09, abs_tol=0.0)\n"
557 " abs_tol\n"
575 double abs_tol);
581 static const char * const _keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL}; in math_isclose()
588 double abs_tol = 0.0; in math_isclose() local
634 abs_tol = PyFloat_AS_DOUBLE(args[3]); in math_isclose()
638 abs_tol = PyFloat_AsDouble(args[3]); in math_isclose()
639 if (abs_tol == -1.0 && PyErr_Occurred()) { in math_isclose()
644 _return_value = math_isclose_impl(module, a, b, rel_tol, abs_tol); in math_isclose()
H A Dcmathmodule.c.h865 "isclose($module, /, a, b, *, rel_tol=1e-09, abs_tol=0.0)\n"
873 " abs_tol\n"
890 double rel_tol, double abs_tol);
896 static const char * const _keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL}; in cmath_isclose()
903 double abs_tol = 0.0; in cmath_isclose() local
937 abs_tol = PyFloat_AS_DOUBLE(args[3]); in cmath_isclose()
941 abs_tol = PyFloat_AsDouble(args[3]); in cmath_isclose()
942 if (abs_tol == -1.0 && PyErr_Occurred()) { in cmath_isclose()
947 _return_value = cmath_isclose_impl(module, a, b, rel_tol, abs_tol); in cmath_isclose()
/third_party/python/Lib/test/
H A Dtest_cmath.py606 self.isclose(1j, 1j, abs_tol=1j)
609 self.isclose(1j, 1j, rel_tol=1j, abs_tol=1j)
632 self.assertAllClose(near_zero_examples, abs_tol=1.5e-03)
633 self.assertAllNotClose(near_zero_examples, abs_tol=0.5e-03)
635 self.assertIsClose(0.001-0.001j, 0.001+0.001j, abs_tol=2e-03)
636 self.assertIsNotClose(0.001-0.001j, 0.001+0.001j, abs_tol=1e-03)
H A Dtest_math.py106 def ulp_abs_check(expected, got, ulp_tol, abs_tol):
116 # Succeed if either abs_error <= abs_tol or ulp_error <= ulp_tol.
117 if abs_error <= abs_tol or ulp_error <= ulp_tol:
122 return fmt.format(abs_error, ulp_error, abs_tol, ulp_tol)
174 def result_check(expected, got, ulp_tol=5, abs_tol=0.0):
208 failure = ulp_abs_check(expected, got, ulp_tol, abs_tol)
239 def ftest(self, name, got, expected, ulp_tol=5, abs_tol=0.0):
248 failure = result_check(expected, got, ulp_tol, abs_tol)
465 self.ftest('cos(-pi/2)', math.cos(-math.pi/2), 0, abs_tol=math.ulp(1))
467 self.ftest('cos(pi/2)', math.cos(math.pi/2), 0, abs_tol
[all...]
H A Dtest_statistics.py2821 self.assertTrue(all(math.isclose(e, a, abs_tol=0.0001)
/third_party/python/Modules/
H A Dmathmodule.c2992 abs_tol: double = 0.0
3010 double abs_tol) in math_isclose_impl()
3016 if (rel_tol < 0.0 || abs_tol < 0.0 ) { in math_isclose_impl()
3048 (diff <= abs_tol)); in math_isclose_impl()
3009 math_isclose_impl(PyObject *module, double a, double b, double rel_tol, double abs_tol) math_isclose_impl() argument
H A Dcmathmodule.c1174 abs_tol: double = 0.0
1191 double rel_tol, double abs_tol) in cmath_isclose_impl()
1197 if (rel_tol < 0.0 || abs_tol < 0.0 ) { in cmath_isclose_impl()
1230 (diff <= abs_tol)); in cmath_isclose_impl()
1190 cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b, double rel_tol, double abs_tol) cmath_isclose_impl() argument

Completed in 16 milliseconds