Directly calculate the bin number. Do not loop.