News for hackers. Stuff that matters.
Re:How many floating-point numbers are in the interval [0,1]? by Lanzaa on Thursday March 02, 2017 @01:28PM (#13776742)
This type of off-by-one error is so common it has its own name: fencepost error[1].

One little note, is that I would disagree with your correction.

> This should be corrected to:

> > The number of values between the two is 0x3f800000 - 0x00000000 == 0x3f800001

I think the value originally computed was correct. It would make more sense to correct the wording rather than just the computed value.

i.e.

> The number of values in the range [0x00000000, 0x3f800000] is 0x3f800000 - 0x00000000 + 1 == 0x3f800001

[1]: https://en.wikipedia.org/wiki/Off-by-one_error#Fencepost_err...

There are no comments on this comment yet.