4 ms·
I see how some people just get the math, but I don't see why programmers here say they find it difficult to understand the window / offset explanation the artic
by coldtea 9y ago
I see how some people just get the math, but I don't see why programmers here say they find it difficult to understand the window / offset explanation the article gives.
A "window" is a common programming term for a range between two values.
An "offset" is a common term for where a value falls after a starting point.
In simpler decimal and equidistant terms, the idea is to split a range of values in windows, divide each window in N values, and store an FP number by storing which window and which index inside the window (0 to N) it falls.
The FP scheme actually uses powers of 2 instead of equal distant windows (so the granularity becomes coarser as the numbers become bigger) but the principle is the same.
- Michielvv 9y agoI'm guessing because if you put those words together, you automatically assume the offset means the position of the window. It's clear enough with the illustration, but using terms that are in very common use for other concepts can make it confusing at the first glance. Also the window explanation hides the fact that it's able to represent really small numbers. (graph implies that 0-1 is the smallest window)
- squeaky-clean 9y agoSmaller is an ambiguous term when it comes to numbers. Is it the lesser value? Or is it the value nearest to 0? It depends on the context. Either way, they cover the sign bit, and the brackets on the diagram show the graphs are not using the sign, just exponent and mantissa. So I'd assume the same principles stand but for 0 to -1, -1- to -2, and so on.
- Michielvv 9y agoI mean smaller as in closer to zero as in exponent lower than 127. That part is obvious in the formula, but not from the graphs. The interesting part of the explanation is that it shows very clearly the effect of the 1.M in the formula. Unfortunately it then does not answer the resulting question: how is zero represented. ( https://en.wikipedia.org/wiki/Signed_zero https://en.wikipedia.org/wiki/Signed_zero does a pretty good job at that though)