[SPARK-2862] histogram method fails on some choices of bucketCount

We can save some FLOPs by computing the stepSize first:
~~~
val stepSize = (max - min) / steps
Range.Int(0, steps, 1).map(s => min + s * stepSize) :+ max
~~~