| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7c106a4 commit 592f65f
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1536,6 +1536,7 @@ sqrt0141 sqrt -1.797e+308 -9.9999999999999999e+306 -> 3.7284476432057307e+152 -1 | |||
| 1536 | 1536 | sqrt0150 sqrt 1.7976931348623157e+308 0.0 -> 1.3407807929942596355e+154 0.0 | |
| 1537 | 1537 | sqrt0151 sqrt 2.2250738585072014e-308 0.0 -> 1.4916681462400413487e-154 0.0 | |
| 1538 | 1538 | sqrt0152 sqrt 5e-324 0.0 -> 2.2227587494850774834e-162 0.0 | |
| 1539 | + sqrt0153 sqrt 5e-324 1.0 -> 0.7071067811865476 0.7071067811865476 | ||
| 1539 | 1540 | ||
| 1540 | 1541 | -- special values | |
| 1541 | 1542 | sqrt1000 sqrt 0.0 0.0 -> 0.0 0.0 | |
@@ -1744,6 +1745,7 @@ cosh0023 cosh 2.218885944363501 2.0015727395883687 -> -1.94294321081968 4.129026 | |||
| 1744 | 1745 | -- large real part | |
| 1745 | 1746 | cosh0030 cosh 710.5 2.3519999999999999 -> -1.2967465239355998e+308 1.3076707908857333e+308 | |
| 1746 | 1747 | cosh0031 cosh -710.5 0.69999999999999996 -> 1.4085466381392499e+308 -1.1864024666450239e+308 | |
| 1748 | + cosh0032 cosh 720.0 0.0 -> inf 0.0 overflow | ||
| 1747 | 1749 | ||
| 1748 | 1750 | -- Additional real values (mpmath) | |
| 1749 | 1751 | cosh0050 cosh 1e-150 0.0 -> 1.0 0.0 | |
@@ -1853,6 +1855,7 @@ sinh0023 sinh 0.043713693678420068 0.22512549887532657 -> 0.042624198673416713 0 | |||
| 1853 | 1855 | -- large real part | |
| 1854 | 1856 | sinh0030 sinh 710.5 -2.3999999999999999 -> -1.3579970564885919e+308 -1.24394470907798e+308 | |
| 1855 | 1857 | sinh0031 sinh -710.5 0.80000000000000004 -> -1.2830671601735164e+308 1.3210954193997678e+308 | |
| 1858 | + sinh0032 sinh 720.0 0.0 -> inf 0.0 overflow | ||
| 1856 | 1859 | ||
| 1857 | 1860 | -- Additional real values (mpmath) | |
| 1858 | 1861 | sinh0050 sinh 1e-100 0.0 -> 1.00000000000000002e-100 0.0 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -607,6 +607,14 @@ def test_complex_near_zero(self): | |||
| 607 | 607 | self.assertIsClose(0.001-0.001j, 0.001+0.001j, abs_tol=2e-03) | |
| 608 | 608 | self.assertIsNotClose(0.001-0.001j, 0.001+0.001j, abs_tol=1e-03) | |
| 609 | 609 | ||
| 610 | + def test_complex_special(self): | ||
| 611 | + self.assertIsNotClose(INF, INF*1j) | ||
| 612 | + self.assertIsNotClose(INF*1j, INF) | ||
| 613 | + self.assertIsNotClose(INF, -INF) | ||
| 614 | + self.assertIsNotClose(-INF, INF) | ||
| 615 | + self.assertIsNotClose(0, INF) | ||
| 616 | + self.assertIsNotClose(0, INF*1j) | ||
| 617 | + | ||
| 610 | 618 | ||
| 611 | 619 | if __name__ == "__main__": | |
| 612 | 620 | unittest.main() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -829,7 +829,7 @@ cmath_sqrt_impl(PyObject *module, Py_complex z) | |||
| 829 | 829 | ax = fabs(z.real); | |
| 830 | 830 | ay = fabs(z.imag); | |
| 831 | 831 | ||
| 832 | - if (ax < DBL_MIN && ay < DBL_MIN && (ax > 0. || ay > 0.)) { | ||
| 832 | + if (ax < DBL_MIN && ay < DBL_MIN) { | ||
| 833 | 833 | /* here we catch cases where hypot(ax, ay) is subnormal */ | |
| 834 | 834 | ax = ldexp(ax, CM_SCALE_UP); | |
| 835 | 835 | s = ldexp(sqrt(ax + hypot(ax, ldexp(ay, CM_SCALE_UP))), | |
@@ -1013,7 +1013,7 @@ cmath_phase_impl(PyObject *module, Py_complex z) | |||
| 1013 | 1013 | double phi; | |
| 1014 | 1014 | ||
| 1015 | 1015 | errno = 0; | |
| 1016 | - phi = c_atan2(z); | ||
| 1016 | + phi = c_atan2(z); /* should not cause any exception */ | ||
| 1017 | 1017 | if (errno != 0) | |
| 1018 | 1018 | return math_error(); | |
| 1019 | 1019 | else | |
| Back | FazBrowse Home | New Git URL |
0 commit comments