News for hackers. Stuff that matters.
Re:How many floating-point numbers are in the interval [0,1]? by surement on Wednesday March 01, 2017 @08:25PM (#13770569)
The discrepancy with the number in the article is that you're including 2^23 mantissae with exponent 0. In any case, the interesting bit is that half of floats are in the interval [-1, 1].
Re:How many floating-point numbers are in the interval [0,1]? by vog on Thursday March 02, 2017 @10:37AM (#13774770)
> the interesting bit is that half of floats are in the interval [-1, 1]

This is not so surprising once you realize that this just means you have the same precision for 1/x as for x, which makes a lot of sense for scientific calculations.

Re:How many floating-point numbers are in the interval [0,1]? by gugagore on Thursday March 02, 2017 @11:21AM (#13775259)
I'll clarify mostly for my sake (I hadn't thought about this before)

f(x) = 1/x takes takes numbers in the range (-1, 1) to numbers outside that range, and vice versa. The representable floats are split evenly between those two sets

Re:How many floating-point numbers are in the interval [0,1]? by vog on Thursday March 02, 2017 @12:34PM (#13776132)
Yes, that was exactly my line of thinking.

One minor nitpick: f(x)=1/x maps [-1,1] to [-inf,-1]u[+1,+inf] ... that is, 1 and -1 are in both sets and mapped onto themselves. However, this detail doesn't affect the argument much.