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

Double64 subnormals bug? #181

Open
milankl opened this issue Dec 22, 2023 · 1 comment
Open

Double64 subnormals bug? #181

milankl opened this issue Dec 22, 2023 · 1 comment

Comments

@milankl
Copy link
Member

milankl commented Dec 22, 2023

Just stumbled across this one here

julia> a = Double64(floatmin(Float64))
2.2250738585072014e-308

julia> b = Double64(0.0,floatmin(Float64))
2.22507385850720138309023271733240406e-308

julia> Float64(a)
2.2250738585072014e-308

julia> Float64(b)
0.0

a,b are technically the same number but one has floatmin in hi one in low, the conversion to Float64 disregards the lo, which for all other Double64s makes sense because as far as I understand eps(hi) > 2lo so truncation to hi is round to nearest in those cases. With b ☝🏼 however I created a Double64 for which eps(hi) > 2lo and so it doesn't round correctly. Is there a function that recalculates hi, lo given a Double64 so that this eps-requirement holds again?

@JeffreySarnoff
Copy link
Member

Well, you are "cheating" -- misusing the constructor ..
still it should have self-corrected
meanwhile b += 0 renormalizes b

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

No branches or pull requests

2 participants