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

Actually both are correct in this case. This is why we should tolerate small numeric difference in tests. @srowen 's version looks good.