~michel-slm/coreutils

6ec1fb46aba4b72623e4aab1a682466f68f5fdf3 — Paul Eggert 7 months ago c01ee18
seq: say why not ‘x += step’

* src/seq.c (print_numbers): Add comment.
1 files changed, 4 insertions(+), 0 deletions(-)

M src/seq.c
M src/seq.c => src/seq.c +4 -0
@@ 307,7 307,11 @@ print_numbers (char const *fmt, struct layout layout,
            write_error ();
          if (out_of_range)
            break;

          /* Mathematically equivalent to 'x += step;', and typically
             less subject to rounding error.  */
          x = first + i * step;

          out_of_range = (step < 0 ? x < last : last < x);

          if (out_of_range)