let bin_exn hist k = if k >= Array.length hist.counts then invalid_argf "invalid bin number %d" k () else hist.bin_limits.(k), hist.bin_limits.(k+1)