I was surprised to discover this: ```julia x = Float16(0.992) y = Float16(6.0e-8) # subnormal julia> d = Single(x)*Single(y) Double(6.0e-8, 0.0) - value: 5.9604644775390625e-08 julia> bits(widen(d.hi) + widen(d.lo)) "00110011100000000000000000000000" julia> bits(widen(x)*widen(y)) "00110011011111100000000000000000" ``` It can be fixed this way: ```julia julia> ys, ye = frexp(y) (Float16(0.5), -23) julia> d = Single(x)*Single(ys) Double(0.496, 0.0) - value: 0.49609375 julia> bits(ldexp(widen(d.hi) + widen(d.lo), ye)) "00110011011111100000000000000000" ``` But given that many treatises say "it's exact unless the splitting overflows," this was a surprising discovery to me.
I was surprised to discover this:
It can be fixed this way:
But given that many treatises say "it's exact unless the splitting overflows," this was a surprising discovery to me.