-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add trigonometric functions for special irrationals #21
Conversation
Codecov ReportBase: 97.43% // Head: 98.24% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
==========================================
+ Coverage 97.43% 98.24% +0.80%
==========================================
Files 2 3 +1
Lines 39 57 +18
==========================================
+ Hits 38 56 +18
Misses 1 1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Pull Request Test Coverage Report for Build 4254120663Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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.
Note that sec(quartπ)
does not have consistent accuracy because sec(x)
is defined by inv(cos(x))
.
julia> sec(quartπ)
1.414213562373095
julia> Float64(sqrt2)
1.4142135623730951
julia> inv(invsqrt2) # same as inv(cos(invsqrt2))
1.414213562373095
This is one of the reasons why I would like to have sec(quartπ) === sqrt2
in #14.
I think we have to be consistent and always return |
There is a counter example
I thought "return Irrational if we have the irrational, otherwise, return Float64" is the best approach (#14 (comment)), and I could not find that much confusion here. However, I agree with merging this PR because this PR just improves the accuracy and there are no breaking changes. My last question is why my PR #14 is not merged yet. I updated the PR to return |
The
It seems unfortunately I lost track of it, and with the recent changes it became outdated. Hence I decided to open a new PR. Generally, I also prefer smaller PRs with fewer changes (e.g., focused only on trigonometric functions) and without additional formatting changes. |
Fixes #20.
This PR is a (largely) reduced and updated version of #14. Arguably it is quite uncontroversial since it just matches the existing behaviour of
sin(pi)
etc. in Base: JuliaLang/julia#42595