Histogram calculations: Use integer arithmetic