[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] SEQ BUG
From: |
Jim Meyering |
Subject: |
Re: [PATCH] SEQ BUG |
Date: |
Sat, 23 Jun 2007 10:47:55 +0200 |
Paul Eggert <address@hidden> wrote:
> Pádraig Brady <address@hidden> writes:
>
>> The attached patch handles this by
>> only counting signficant digits from the operands.
>
> I'd rather use the idea I proposed earlier. Here's an implementation
> of it, which works on all the test cases in your patch. In addition,
> it works on the wilder counterexamples I suggested (which alas we
> can't put into the test suite since they're machine-specific).
>
> 2007-06-22 Paul Eggert <address@hidden>
>
> * NEWS: seq no longer mishandles obvious cases like
> "seq 0 0.000001 0.000003" by omitting the last output number.
> * doc/coreutils.texi (seq invocation): Remove advice about workaround
> for seq off-by-one problem, since the bug is fixed now. Replace
> it with more-generic advice about rounding error.
> * src/seq.c (long_double_format, print_numbers):
> New arg NUMERIC_FORMAT. All uses changed.
>
> 2007-06-22 Pádraig Brady <address@hidden> (trivial change)
>
> * tests/seq/basic: Add test cases for seq off-by-one problem.
Thanks to both of you!
I've applied that patch with minor changes to make the new code use the
STREQ macro rather than using strcmp directly. That has been informal
policy for years, since using STREQ makes the code more readable.
In fact, I think it's worth an addition to Makefile.maint,
so converted a few more and added a rule to enforce the policy:
2007-06-23 Jim Meyering <address@hidden>
Prefer "STREQ (a, b)" over "strcmp (a, b) == 0"; similar for != 0.
* src/base64.c (main): Likewise.
* src/install.c (setdefaultfilecon): Likewise.
* src/sort.c (main): Likewise.
* Makefile.maint (sc_prohibit_strcmp): New rule.
* .x-sc_prohibit_strcmp: New file, to list the few exceptions.
* Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_strcmp.
- Re: [PATCH] SEQ BUG, (continued)
- Re: [PATCH] SEQ BUG, Pádraig Brady, 2007/06/20
- Re: [PATCH] SEQ BUG, Pádraig Brady, 2007/06/20
- Re: [PATCH] SEQ BUG, Paul Eggert, 2007/06/22
- Re: [PATCH] SEQ BUG, Pádraig Brady, 2007/06/22
- Re: [PATCH] SEQ BUG, Paul Eggert, 2007/06/22
- Re: [PATCH] SEQ BUG, Jim Meyering, 2007/06/22
- Re: [PATCH] SEQ BUG, Micah Cowan, 2007/06/22
- Re: [PATCH] SEQ BUG, Paul Eggert, 2007/06/22
- Re: [PATCH] SEQ BUG, Pádraig Brady, 2007/06/22
- Re: [PATCH] SEQ BUG, Paul Eggert, 2007/06/22
- Re: [PATCH] SEQ BUG,
Jim Meyering <=
Re: SEQ BUG, John Cowan, 2007/06/07