summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ministat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ministat.c b/ministat.c
index fee047b..d611d20 100644
--- a/ministat.c
+++ b/ministat.c
@@ -358,7 +358,7 @@ PlotSet(struct dataset *ds, int val)
}
i = -1;
for (n = 0; n < ds->n; n++) {
- x = (ds->points[n] - pl->x0) / pl->dx;
+ x = floor((ds->points[n] - pl->x0) / pl->dx);
if (x == i) {
j++;
} else {
@@ -368,17 +368,17 @@ PlotSet(struct dataset *ds, int val)
pl->data[j * pl->width + x] |= val;
}
if (!isnan(Stddev(ds))) {
- x = ((Avg(ds) - Stddev(ds)) - pl->x0) / pl->dx;
- m = ((Avg(ds) + Stddev(ds)) - pl->x0) / pl->dx;
+ x = floor(((Avg(ds) - Stddev(ds)) - pl->x0) / pl->dx);
+ m = ceil(((Avg(ds) + Stddev(ds)) - pl->x0) / pl->dx);
pl->bar[bar][m] = '|';
pl->bar[bar][x] = '|';
for (i = x + 1; i < m; i++)
if (pl->bar[bar][i] == 0)
pl->bar[bar][i] = '_';
}
- x = (Median(ds) - pl->x0) / pl->dx;
+ x = floor((Median(ds) - pl->x0) / pl->dx);
pl->bar[bar][x] = 'M';
- x = (Avg(ds) - pl->x0) / pl->dx;
+ x = floor((Avg(ds) - pl->x0) / pl->dx);
pl->bar[bar][x] = 'A';
}