Plotting the distribution of floating point numbers

There is an interesting post from 2010 that plotted the distribution of a custom 6-bit floating point format. I was curious what the resulting graph would look like if we plotted IEEE single precision floating point numbers, instead. Luckily, this turns out to be very easy using the gnuplot utility! The trick is to use the nextafterf (manpage) function to create an enumeration of the floating…