diff options
author | David Cournapeau <cournape@gmail.com> | 2009-07-21 01:57:42 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-07-21 01:57:42 +0000 |
commit | 661ac79b5e3af1aba0e33bfccba1585cf6e6e9e5 (patch) | |
tree | 3f66deb47ee9bb0fabf93bf0c18a8bab1bab63c3 | |
parent | a173c4740405d8d5e0c482ad0e065f85427018e7 (diff) | |
download | numpy-661ac79b5e3af1aba0e33bfccba1585cf6e6e9e5.tar.gz |
Add a few more sanity checks for atan2.
-rw-r--r-- | numpy/core/tests/test_umath.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index 6c6462584..c82e5af7c 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -234,6 +234,11 @@ def test_arctan2_special_values(): def assert_arctan2_isnzero(x, y): assert ncu.arctan2(x, y) == 0 and np.signbit(ncu.arctan2(x, y)) + # atan2(1, 1) returns pi/4. + yield assert_almost_equal, ncu.arctan2(1, 1), 0.25 * np.pi + yield assert_almost_equal, ncu.arctan2(-1, 1), -0.25 * np.pi + yield assert_almost_equal, ncu.arctan2(1, -1), 0.75 * np.pi + # atan2(+-0, -0) returns +-pi. yield assert_almost_equal, ncu.arctan2(np.PZERO, np.NZERO), np.pi yield assert_almost_equal, ncu.arctan2(np.NZERO, np.NZERO), -np.pi |