We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f5be4b commit c98ad66Copy full SHA for c98ad66
jepler_udecimal/utrig.py
@@ -198,11 +198,10 @@ def asin(x, context=None):
198
199
with localcontext(context) as ctx:
200
ctx.prec += 2
201
- pi = Decimal(1).atan() * 4
202
if x == 1:
203
- r = pi / 2 # pi * 1/2 radians
+ r = atan(Decimal(1)) * 2 # pi * 1/2 radians
204
elif x == -1:
205
- r = pi / -2 # pi * -1/2 radians
+ r = atan(Decimal(1)) * -2 # pi * -1/2 radians
206
else:
207
r = atan(x / (1 - x * x).sqrt())
208
return r / 1
@@ -227,7 +226,7 @@ def acos(x, context=None):
227
226
228
r = Decimal(0) # 0 radians
229
230
- r = Decimal(1).atan() * 4 # pi radians
+ r = atan(Decimal(1)) * 4 # pi radians
231
232
r = atan((1 - x * x).sqrt() / x)
233
if r < 0:
0 commit comments