X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fhistogram.c;h=afc40013e02865f46f82549599f4f9cb84812706;hb=33790599fcfd2de8553568801791b78704aae4de;hp=7fc2d08e3de341a49455e0395d7283e204384f79;hpb=cdae9856ee4695fef212a4dcf24d81dff484c7d4;p=pspp diff --git a/src/math/histogram.c b/src/math/histogram.c index 7fc2d08e3d..afc40013e0 100644 --- a/src/math/histogram.c +++ b/src/math/histogram.c @@ -222,12 +222,14 @@ histogram_create (double bin_width, double min, double max) assert (bin_width > 0); + bin_width = chart_rounded_tick (bin_width); bins = adjust_bin_ranges (bin_width, min, max, &adjusted_min, &adjusted_max); /* Force the number of bins to lie in a sensible range. */ if (bins > MAX_BINS) { - bins = adjust_bin_ranges ((max - min) / (double) (MAX_BINS - 1), + bin_width = chart_rounded_tick ((max - min) / (double) (MAX_BINS - 1)); + bins = adjust_bin_ranges (bin_width, min, max, &adjusted_min, &adjusted_max); }