ieee754-visualization icon indicating copy to clipboard operation
ieee754-visualization copied to clipboard

bug?

Open Qyokizzzz opened this issue 3 years ago • 3 comments

image

Qyokizzzz avatar Jan 17 '22 07:01 Qyokizzzz

Thanks for taking time to report this.

To be honest I created it almost 10 years ago and I really don't remember the exact details. Certainly this seems like a bug (exponent is 0, but equations suggest it's 1), but on the other hand it is treated as 0 inside the sum in brackets.

It would be really hard for me now to try to understand it again and fix that. If I get a chance I'll try to have a look into it (it may be related to issue mentioned in #2). But I can't really promise anything.

Anyway, thanks again for using my tool and reporting an issue! I hope it was helpful :)

bartaz avatar Jan 17 '22 08:01 bartaz

@Qyokizzzz I found the part of the Wiki article that explains this: https://en.wikipedia.org/wiki/Double-precision_floating-point_format#Exponent_encoding. So, the behaviour is explicit and correct, because when exponent is 0 it is treated as special case and the standard equation doesn't apply.

But indeed this is confusing that the last line of equation says 2^e-1023 while it's really 2^1-1023.

bartaz avatar Jan 17 '22 14:01 bartaz

@Qyokizzzz I found the part of the Wiki article that explains this: https://en.wikipedia.org/wiki/Double-precision_floating-point_format#Exponent_encoding. So, the behaviour is explicit and correct, because when exponent is 0 it is treated as special case and the standard equation doesn't apply.

But indeed this is confusing that the last line of equation says 2^e-1023 while it's really 2^1-1023.

It should be a typo.

Wikipedia says "00000000000 is used to represent a signed zero (if F = 0) and subnormals (if F ≠ 0)".

That means it represents all underflowed numbers when the exponent is 0, so 00000000001 is the special value to cause the number before fraction is 0.

Qyokizzzz avatar Jan 26 '22 12:01 Qyokizzzz