Skip to content

Commit ca94eb4

Browse files
author
Matthias Koeppe
committed
MPowerSeries.exp: Don't use symbolics to compute exp(0)
1 parent 4103129 commit ca94eb4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sage/rings/multi_power_series_ring_element.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,9 +1944,12 @@ def exp(self, prec=infinity):
19441944
R = self.parent()
19451945
Rbg = R._bg_power_series_ring
19461946

1947-
from sage.functions.log import exp
19481947
c = self.constant_coefficient()
1949-
exp_c = exp(c)
1948+
if not c:
1949+
exp_c = self.base_ring().one()
1950+
else:
1951+
from sage.functions.log import exp
1952+
exp_c = exp(c)
19501953
x = self._bg_value - c
19511954
if x.is_zero():
19521955
return exp_c

0 commit comments

Comments
 (0)