GNU bug report logs -
#75994
"seq -w" is broken for large enough numbers
Previous Next
To reply to this bug, email your comments to 75994 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#75994
; Package
coreutils
.
(Sat, 01 Feb 2025 17:45:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Alexey Dobriyan <adobriyan <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Sat, 01 Feb 2025 17:45:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
coreutils 9.3, 9.5
Steps to reproduce:
# 21 digits
$ seq 111111111111111111111 1 111111111111111111113
111111111111111111111
111111111111111111112
111111111111111111113
$ seq -w 111111111111111111111 1 111111111111111111113
111111111111111111112 # what?
111111111111111111112
111111111111111111112
111111111111111111112
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#75994
; Package
coreutils
.
(Sat, 01 Feb 2025 20:02:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 75994 <at> debbugs.gnu.org (full text, mbox):
On 01/02/2025 17:43, Alexey Dobriyan wrote:
> coreutils 9.3, 9.5
>
> Steps to reproduce:
>
> # 21 digits
> $ seq 111111111111111111111 1 111111111111111111113
> 111111111111111111111
> 111111111111111111112
> 111111111111111111113
With no -w, seq doesn't use floating point
and instead operates on the ASCII values directly.
>
> $ seq -w 111111111111111111111 1 111111111111111111113
> 111111111111111111112 # what?
> 111111111111111111112
> 111111111111111111112
> 111111111111111111112
With -w seq will use long doubles internally,
which usually have a 64 bit significand.
I.e. once you go above 2^64, you get approximations of integers.
Now we could adjust seq to use the "ASCII" increment method
in this case by handling leading zeros appropriately.
It would be good to know your use case here though,
as to know how common this issue might be.
cheers,
Pádraig
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#75994
; Package
coreutils
.
(Sat, 01 Feb 2025 21:23:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 75994 <at> debbugs.gnu.org (full text, mbox):
On Sat, Feb 01, 2025 at 08:01:18PM +0000, Pádraig Brady wrote:
> With -w seq will use long doubles internally,
> which usually have a 64 bit significand.
> I.e. once you go above 2^64, you get approximations of integers.
>
> Now we could adjust seq to use the "ASCII" increment method
> in this case by handling leading zeros appropriately.
> It would be good to know your use case here though,
> as to know how common this issue might be.
The usecase is using GNU seq as reference implementation. :^)
I'd do decimal fixed point. Given that seq only does addition
it won't be that bad.
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#75994
; Package
coreutils
.
(Sun, 02 Feb 2025 07:29:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 75994 <at> debbugs.gnu.org (full text, mbox):
On 2025-02-01 12:34, Alexey Dobriyan wrote:
> I'd do decimal fixed point.
Patches along those lines would be welcome, I expect.
This bug report was last modified 6 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.