Skip to content
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 direct type conversion on Dual #168

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Add direct type conversion on Dual #168

merged 1 commit into from
Aug 15, 2024

Conversation

adrhill
Copy link
Owner

@adrhill adrhill commented Aug 15, 2024

Closes #164 by supporting:

  • Int(d::Dual)
  • Integer(d::Dual)
  • Float64(d::Dual)
  • Float32(d::Dual)

This currently throws an InexactError when tracers are not empty. This is analogous to ForwardDiff's approach.

Depending on the outcome of the ongoing discussion in #167, we might want to make this less conservative for Int(d) and Integer(d) in the future.

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 78.26087% with 5 lines in your changes missing coverage. Please review.

Project coverage is 91.65%. Comparing base (8587e0d) to head (eba1edc).
Report is 1 commits behind head on main.

Files Patch % Lines
test/test_constructors.jl 75.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
+ Coverage   90.25%   91.65%   +1.40%     
==========================================
  Files          37       37              
  Lines        1570     1786     +216     
==========================================
+ Hits         1417     1637     +220     
+ Misses        153      149       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adrhill adrhill merged commit 8251cb3 into main Aug 15, 2024
6 checks passed
@adrhill adrhill deleted the ah/cast-dual branch August 15, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More problems regarding round
2 participants