astrofrog / fast-histogram

:zap: Fast 1D and 2D histogram functions in Python :zap:
BSD 2-Clause "Simplified" License
267 stars 28 forks source link

Minimise floating point errors when calculating indices. Fixes #45 #53

Closed 3553x closed 3 years ago

3553x commented 3 years ago

See #45 for a description of the problem. This code implements the suggested changes. I also ran benchmarks and did not observe a significant difference in terms of performance before and after the changes. All 7 tests also passed.