Skip to content

Commit 1817253

Browse files
committed
utrig: Fix logb(0)
1 parent ea6e2e5 commit 1817253

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jepler_udecimal/utrig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def atan(x, context=None):
103103
t = Decimal(1)
104104
i = 3
105105

106-
while t.logb() > -ctx.prec:
106+
while t and t.logb() > -ctx.prec:
107107
u *= f
108108
t = u / i
109109
i += 2
@@ -134,7 +134,7 @@ def sin(x, context=None):
134134
r = a = x
135135
q = -x * x
136136
i = 3
137-
while a.logb() > -ctx.prec:
137+
while a and a.logb() > -ctx.prec:
138138
a *= q / (i * (i - 1))
139139
r += a
140140
i += 2

0 commit comments

Comments
 (0)