Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit ada47e4

Browse files
committed
handle complex infinities
1 parent f158660 commit ada47e4

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/sage/functions/other.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -2751,21 +2751,27 @@ def _eval_(self, x):
27512751
sage: fresnel_sin(-oo)
27522752
-1/2
27532753
sage: fresnel_sin(I*oo)
2754-
-I/2
2754+
-1/2*I
27552755
sage: fresnel_sin(-I*oo)
2756-
I/2
2756+
1/2*I
27572757
"""
27582758
if isinstance(x, Expression):
27592759
if x.is_negative():
2760-
return -self(-x)
2760+
return -fresnel_sin(-x)
27612761
if x.is_trivial_zero():
27622762
return x
27632763
if x.is_infinity():
2764-
return one_half
2764+
if x.is_positive_infinity():
2765+
return one_half
2766+
elif x.imag_part().is_positive_infinity():
2767+
return -I*one_half
2768+
elif x.imag_part().is_negative_infinity():
2769+
return I*one_half
2770+
elif x < 0:
2771+
return -fresnel_sin(-x)
27652772
elif not x:
27662773
return x
27672774

2768-
27692775
def _evalf_(self, x, parent=None, algorithm=None):
27702776
r"""
27712777
EXAMPLES::

0 commit comments

Comments
 (0)