counting large numbers of events in small floating point registers

11 points by fanf


cblake

The mantissa will typically be the rest of an 8 or 16 bit integer (though languages such as Zig and C23 allow more adventurous integer sizes).

Since you mention histograms as the context, that would almost surely be an array of these counters. So, it's not hard to have a packed array of b-bit numbers for any b >= 1. You probably already know, but it seemed worth a mention. This is an example impl in Nim, but the ideas should port easily to any PLang with shift/mask bit-ops. It's similar to a bit-vector, but with batches of b-bits.