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

fix an inexact error #207

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

putianyi889
Copy link
Contributor

@putianyi889 putianyi889 commented Oct 21, 2024

This bug was introduced by the overhaul of Jacobi connection #145 , which basically replaced with ==.

julia> Integer(1.9-0.9)
ERROR: InexactError: Int64(0.9999999999999999)
Stacktrace:
 [1] Int64
   @ .\float.jl:994 [inlined]
 [2] Integer(x::Float64)
   @ Core .\boot.jl:926
 [3] top-level scope
   @ REPL[5]:1

also simplified some codes, particularly those introduced by #145 .

Edit: #211 conflicts with this... Apart from other code simplifications, isapproxinteger requires multiple computation of k. This PR reduces the computation to only once and also let the lower level handle the errors.

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.01%. Comparing base (833245b) to head (cf2ec38).

Files with missing lines Patch % Lines
src/classical/jacobi.jl 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #207      +/-   ##
==========================================
- Coverage   92.14%   92.01%   -0.13%     
==========================================
  Files          18       18              
  Lines        1858     1841      -17     
==========================================
- Hits         1712     1694      -18     
- Misses        146      147       +1     

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

@putianyi889 putianyi889 marked this pull request as draft October 21, 2024 07:11
@putianyi889 putianyi889 marked this pull request as ready for review October 22, 2024 06:33
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.

1 participant