Hardwire return values for domain limits of arcsin and arccos - #8
Merged
Conversation
jepler
requested changes
Feb 14, 2022
jepler
left a comment
Collaborator
There was a problem hiding this comment.
Thank you! I have some comments and possibly changes to request
| if x == 1: | ||
| r = pi / 2 # pi * 1/2 radians | ||
| elif x == -1: | ||
| r = pi * 3 / 2 # pi * 3/2 radians |
Contributor
Author
There was a problem hiding this comment.
Using the unit circle method, 3/2pi rad is equal to -1/2pi rad
Collaborator
There was a problem hiding this comment.
I'd still rather see it match math.asin:
>>> math.asin(-1)
-1.5707963267948966
Contributor
Author
There was a problem hiding this comment.
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.
Collaborator
|
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
Contributor
Author
|
updated the |
jepler
self-requested a review
February 15, 2022 15:53
jepler
approved these changes
Feb 15, 2022
jepler
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for sticking through my requested changes! I cleaned up a few last things.
adafruit-adabot
added a commit
to adafruit/CircuitPython_Community_Bundle
that referenced
this pull request
Feb 16, 2022
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix for issue #7