Handle rounding errors on bin number computation