Histogram of image intensities
Due the way floating point values work, you probably don't want to do an exact equality check. You probably want something more like this in your loop:

uint32 sums [ 11 ] = { 0 };
for (int j = 0; j &lt; 1920 * 1080 * 4; j += 4) {
    size_t bucket = static_cast&lt;size_t&gt;(framebuffer [ j ] * 10.0);
    sums [ bucket ]++;
}


Note that there are 11 buckets because the range includes both 0 and 1. If you want only 10 buckets and want to put any pixels that have a value of 1 in them into the top bucket, you could do:

uint32 sums [ 10 ] = { 0 };


and change the bucket index calculation to:

size_t bucket = static_cast&lt;size_t&gt;(framebuffer [ j ] * 10.0);
bucket = std::min(bucket, 9);