JuliaMath / JuliaMath/DoubleFloats.jl

Double64 subnormals bug?

Open
#181 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
172
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Just stumbled across this one here
```julia
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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.