3 ms·
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
by iudqnolq 4y ago
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.
- mprime1 4y agoYou can certainly map floats to int ‘bin number’ which is the index into an array. No need for a map. But the ‘naive’ histogram is an example of a map using float keys.