← Back to context

Comment by ryan-duve

4 years ago

As 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.

Edit: to clarify, I do not understand how the floating point representation of 0.00005 is interpreted with windows/offsets.

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”.

  • Scientific notation is easily seen as just floating point in base ten, though. Had the same rules about leading 1 and such. Add in significant digits, and you have most all of the same concerns.