* Juergen Salk <[EMAIL PROTECTED]> [010914 23:15]:

> The seq output may vary with different systems or compilers
> and does not always print all numbers from FIRST to LAST.

> Please find attached a suggested patch (unified diff) to 
> overcome this problem.

I have to apologize for my recent patch. Please find attached
a corrected version. 

Best regards - Juergen 
--- seq.c.orig  Fri Sep 14 22:42:54 2001
+++ seq.c       Sat Sep 15 00:06:40 2001
@@ -414,6 +414,7 @@
   if (first > last)
     {
       int i;
+      double threshold;
 
       if (step >= 0)
        {
@@ -425,11 +426,12 @@
        }
 
       printf (fmt, first);
+      threshold = last + 0.5 * step;
       for (i = 1; /* empty */; i++)
        {
          double x = first + i * step;
 
-         if (x < last)
+         if (x < threshold)
            break;
 
          fputs (separator, stdout);
@@ -439,6 +441,7 @@
   else
     {
       int i;
+      double threshold;
 
       if (step <= 0)
        {
@@ -450,11 +453,12 @@
        }
 
       printf (fmt, first);
+      threshold = last + 0.5 * step;
       for (i = 1; /* empty */; i++)
        {
          double x = first + i * step;
 
-         if (x > last)
+         if (x > threshold)
            break;
 
          fputs (separator, stdout);

Reply via email to