summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/seq.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/seq.c b/src/seq.c
index 3cddcca58..c8997ce5c 100644
--- a/src/seq.c
+++ b/src/seq.c
@@ -399,15 +399,16 @@ print_numbers (const char *format_str)
/* NOTREACHED */
}
+ printf (format_str, first);
for (i = 0; /* empty */; i++)
{
double x = first + i * step;
- printf (format_str, x);
- if (x <= last)
+ if (x < last)
break;
fputs (separator, stdout);
+ printf (format_str, x);
}
}
else
@@ -421,15 +422,16 @@ print_numbers (const char *format_str)
/* NOTREACHED */
}
- for (i = 0; /* empty */; i++)
+ printf (format_str, first);
+ for (i = 1; /* empty */; i++)
{
double x = first + i * step;
- printf (format_str, x);
- if (x >= last)
+ if (x > last)
break;
fputs (separator, stdout);
+ printf (format_str, x);
}
}
fputs (terminator, stdout);