-
Notifications
You must be signed in to change notification settings - Fork 1
Hardwire return values for domain limits of arcsin and arccos
#8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jepler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I have some comments and possibly changes to request
jepler_udecimal/utrig.py
Outdated
| if x == 1: | ||
| r = pi / 2 # pi * 1/2 radians | ||
| elif x == -1: | ||
| r = pi * 3 / 2 # pi * 3/2 radians |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be -pi/2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the unit circle method, 3/2pi rad is equal to -1/2pi rad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still rather see it match math.asin:
>>> math.asin(-1)
-1.5707963267948966There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Hadn't considered compatibility with math.asin. Thanks for your patience.
3/2 pi rad is equal to -pi/2 rad other changes were caused by file editing issues. sorry about that.
|
I believe your change to the return-precision of acos was correct, and the test cases need to be updated to reflect the change: |
…sin` Also update acos example to reflect actual result rounded to 28 digits. Verified other examples, as well.
```>>> math.asin(-1)
-1.5708
>>> Decimal.asin(-1)
Decimal('-1.570796326794896619231321692')```
also updated `acos` example; verified other examples, as well
|
updated the |
jepler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for sticking through my requested changes! I cleaned up a few last things.
Updating https://github.com/jepler/Jepler_CircuitPython_udecimal to 1.0.5 from 1.0.4: > Merge pull request circuitpython/Jepler_CircuitPython_udecimal#10 from jepler/update-black-ci-etc > Merge pull request circuitpython/Jepler_CircuitPython_udecimal#8 from CedarGroveStudios/patch-1
fix for issue #7