Why not just multiply each key by ten to the power of your desired precision, then convert to int?
If you're rounding anyway it's basically the same amount of work.
If you're rounding anyway it's basically the same amount of work.
But the ‘naive’ histogram is an example of a map using float keys.