Skip to content

Commit 5dbf417

Browse files
update asin(-1) to equal -pi/2 rads to be consistent with math.asin
Also update acos example to reflect actual result rounded to 28 digits. Verified other examples, as well.
1 parent 6424dcb commit 5dbf417

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
@@ -34,7 +34,7 @@
3434
>>> Decimal('.7').atan()
3535
Decimal('0.6107259643892086165437588765')
3636
>>> Decimal('.1').acos()
37-
Decimal('1.47062890563333682288579851219')
37+
Decimal('1.470628905633336822885798512')
3838
>>> Decimal('-.1').asin()
3939
Decimal('-0.1001674211615597963455231795')
4040
>>> Decimal('.4').tan()
@@ -202,7 +202,7 @@ def asin(x, context=None):
202202
if x == 1:
203203
r = pi / 2 # pi * 1/2 radians
204204
elif x == -1:
205-
r = pi * 3 / 2 # pi * 3/2 radians
205+
r = pi * 3 / 2 # pi * -1/2 radians
206206
else:
207207
r = atan(x / (1 - x * x).sqrt())
208208
return r / 1

0 commit comments

Comments
 (0)