bug#12959: "seq -w -1e-3 9" misaligned

2012-11-23 Thread Bernhard Voelker
On 11/23/2012 11:13 AM, Pádraig Brady wrote: > Thanks for the review! > Pádraig. No worries, you're welcome. For what it's worth, you may also add an integer test case like "seq -w -1e3 1" which is/was also affected by this bug: $ seq -w -1e3 1 | head -n 2 -1000 -999 Have a nice day, Be

bug#12959: "seq -w -1e-3 9" misaligned

2012-11-23 Thread Pádraig Brady
On 11/23/2012 10:08 AM, Bernhard Voelker wrote: On 11/23/2012 10:04 AM, Pádraig Brady wrote: The attached should fix this. * src/seq.c (scan_arg): Calculate the width more accurately for numbers specified using scientific notation. * tests/misc/seq.pl: Add test cases for cases that were mish

bug#12959: "seq -w -1e-3 9" misaligned

2012-11-23 Thread Bernhard Voelker
On 11/23/2012 10:04 AM, Pádraig Brady wrote: > > The attached should fix this. > * src/seq.c (scan_arg): Calculate the width more accurately > for numbers specified using scientific notation. > * tests/misc/seq.pl: Add test cases for cases that were mishandled s/$/./ > * NEWS: Mention the fix.

bug#12959: "seq -w -1e-3 9" misaligned

2012-11-23 Thread Pádraig Brady
On 11/22/2012 10:58 AM, Pádraig Brady wrote: On 11/22/2012 10:49 AM, Marcel Böhme wrote: Hi, While the output of (1) "seq -w -1e-2 9" prints the width as expected, the output of (2) "seq -w -1e-3 9" does not: (1) vs. (2) -0.01 | -0.001 00.99 | 0.999 01.99 | 1.999 02.99 | 2.999 03.99 | 3.999

bug#12959: Aw: bug#12959: "seq -w -1e-3 9" misaligned

2012-11-22 Thread Marcel Böhme
Hi Pádraig, The problem seems to be related to the computation of ret.width for arguments with exponent in method scan_arg. Apparently, the ret.precision is handled in the presence of an exponent while the ret.width is not. More evidence: $ seq -w 1e3 1e5 | head -2 1000 1001 $ seq -w 1e3 1e5 |

bug#12959: "seq -w -1e-3 9" misaligned

2012-11-22 Thread Pádraig Brady
On 11/22/2012 10:49 AM, Marcel Böhme wrote: Hi, While the output of (1) "seq -w -1e-2 9" prints the width as expected, the output of (2) "seq -w -1e-3 9" does not: (1) vs. (2) -0.01 | -0.001 00.99 | 0.999 01.99 | 1.999 02.99 | 2.999 03.99 | 3.999 04.99 | 4.999 05.99 | 5.999 06.99 | 6.999 07.9

bug#12959: "seq -w -1e-3 9" misaligned

2012-11-22 Thread Marcel Böhme
Hi, While the output of (1) "seq -w -1e-2 9" prints the width as expected, the output of (2) "seq -w -1e-3 9" does not: (1) vs. (2) -0.01 | -0.001 00.99 | 0.999 01.99 | 1.999 02.99 | 2.999 03.99 | 3.999 04.99 | 4.999 05.99 | 5.999 06.99 | 6.999 07.99 | 7.999 08.99 | 8.999 Similarly, see "seq -w