Floating point visually explained (2017)
fabiensanglard.net
Floating point visually explained (2017)
1–10 of 58 posts
Re: Floating point visually explained (2017)
#2I'm sure the author intended to keep the article short, but I think it would benefit from more examples, including a number like 5e-5 or something. It isn't clear to me how the window/offset explains that.
Edit: to clarify, I do not understand how the floating point representation of 0.00005 is interpreted with windows/offsets.
Re: Floating point visually explained (2017)
#3As someone who never learned the "dreadful notation... discouraging legions of programmers", this was really helpful! The "canonical" equation doesn't mean anything to me and the window/offset explanation does. I'm sure the author intended to keep the article short, but I think it would benefit from more examples, including a number like 5e-5 or something. It isn't clear to me how the window/offset explains that. Edi…
The number after e is a power of 10:
5e2 = 5 * 10^2 = 5 * 100 = 500
5e-5 = 5 * 10^-5 = 5 / 100000 = 0.00005
Once you internalize this, you just read the exponent as “x zeroes to the left”.Re: Floating point visually explained (2017)
#4As someone who never learned the "dreadful notation... discouraging legions of programmers", this was really helpful! The "canonical" equation doesn't mean anything to me and the window/offset explanation does. I'm sure the author intended to keep the article short, but I think it would benefit from more examples, including a number like 5e-5 or something. It isn't clear to me how the window/offset explains that. Edi…
5e-5 is not really related to FP, it’s just scientific notation. The number itself is still stored as shown in the post, it’s just being printed in a more compact form. The number after e is a power of 10: 5e2 = 5 * 10^2 = 5 * 100 = 500 5e-5 = 5 * 10^-5 = 5 / 100000 = 0.00005 Once you internalize this, you just read the exponent as “x zeroes to the left”.
Re: Floating point visually explained (2017)
#5As someone who never learned the "dreadful notation... discouraging legions of programmers", this was really helpful! The "canonical" equation doesn't mean anything to me and the window/offset explanation does. I'm sure the author intended to keep the article short, but I think it would benefit from more examples, including a number like 5e-5 or something. It isn't clear to me how the window/offset explains that. Edi…
5e-5 is not really related to FP, it’s just scientific notation. The number itself is still stored as shown in the post, it’s just being printed in a more compact form. The number after e is a power of 10: 5e2 = 5 * 10^2 = 5 * 100 = 500 5e-5 = 5 * 10^-5 = 5 / 100000 = 0.00005 Once you internalize this, you just read the exponent as “x zeroes to the left”.
Re: Floating point visually explained (2017)
#6It's certainly much clearer than the windowing and bucketing in this article.
Re: Floating point visually explained (2017)
#7I don't understand how M * 2^E (modulo small representation details) is difficult to grasp. Then you have decimal types as M * 10^E. It's certainly much clearer than the windowing and bucketing in this article.
The windowing explanation shows me a path from the intent of the designer through to the implementation (the algorithm). Now I can retain that knowledge.
Re: Floating point visually explained (2017)
#8Re: Floating point visually explained (2017)
#9Re: Floating point visually explained (2017)
#10Why is there no float type with linear precision?