Skip to content

Commit

Permalink
Add rule for ArcTan[ComplexInfinity] (#1249)
Browse files Browse the repository at this point in the history
Fixes #510
  • Loading branch information
rocky authored Dec 28, 2024
1 parent 7925403 commit 4229363
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions mathics/builtin/numbers/trig.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ class ArcTan(MPMathFunction):
rules = {
"ArcTan[0]": "0",
"ArcTan[1]": "Pi/4",
"ArcTan[DirectedInfinity[]]": "Indeterminate",
"ArcTan[Undefined]": "Undefined",
"ArcTan[Undefined, x_]": "Undefined",
"ArcTan[y_, Undefined]": "Undefined",
Expand Down
7 changes: 7 additions & 0 deletions test/builtin/numbers/test_trig.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from test.helper import check_evaluation

import pytest
from sympy.core.numbers import ComplexInfinity


def test_ArcCos():
Expand All @@ -29,6 +30,12 @@ def test_ArcCos():
@pytest.mark.parametrize(
("str_expr", "msgs", "str_expected", "fail_msg"),
[
(
"ArcTan[ComplexInfinity]",
None,
"Indeterminate",
"Rule added for Arctan[ComplexInfinity]",
),
("ArcTan[-1, 1]", None, "3 Pi / 4", None),
("ArcTan[1, -1]", None, "-Pi / 4", None),
("ArcTan[-1, -1]", None, "-3 Pi / 4", None),
Expand Down

0 comments on commit 4229363

Please sign in to comment.