GNU bug report logs -
#79369
seq generates wrong sequences for big numbers
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Tue, 2 Sep 2025 20:53:31 +0100
with message-id <536fa85d-1789-4548-bdfa-f12a9c51083e <at> draigBrady.com>
and subject line Re: bug#79369: seq generates wrong sequences for big numbers
has caused the debbugs.gnu.org bug report #79369,
regarding seq generates wrong sequences for big numbers
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
79369: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79369
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
It looks like seq for integers bigger than 2^64 sometimes generate wrong
results. There are few examples of wrong output I have found:
$ seq 18446744073709551617 inf | head -3
18446744073709551616
18446744073709551617
18446744073709551618
$ seq 10000000000000000000000000000 inf | head -3
9999999999999999999731564544
9999999999999999999731564545
9999999999999999999731564546
$ seq -1000000000000000000000000 0 | head -3
-1000000000000000000000000
-1000000000000000000000000
-1000000000000000000000000
It is similar to bug #75994 which reports the same issue but only for "-w"
option.
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
On 02/09/2025 16:52, Pádraig Brady wrote:
> On 02/09/2025 13:11, ondra007.tom <at> seznam.cz wrote:
>> It looks like seq for integers bigger than 2^64 sometimes generate wrong
>> results. There are few examples of wrong output I have found:
>>
>>
>> $ seq 18446744073709551617 inf | head -3
>>
>> 18446744073709551616
>> 18446744073709551617
>> 18446744073709551618
>>
>>
>>
>>
>>
>> $ seq 10000000000000000000000000000 inf | head -3
>>
>>
>> 9999999999999999999731564544
>> 9999999999999999999731564545
>> 9999999999999999999731564546
>
> We can improve for the above 2 cases anyway,
> with something like the attached.
>
> Large magnitude negative start values are still problematic.
Ok I pushed that with a test included:https://github.com/coreutils/coreutils/commit/701416709
Marking this as done.
thanks,
Padraig
This bug report was last modified 11 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.