Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

It seems intuitively obvious to me, which means that it might be wrong. -- Chris Torek


devel / comp.lang.awk / Re: floating point: too many significant digits

SubjectAuthor
* floating point: too many significant digitsLaurent MANCHON
+* Re: floating point: too many significant digitsJ Naman
|`- Re: floating point: too many significant digitsLaurent MANCHON
+* Re: floating point: too many significant digitsJanis Papanagnou
|`* Re: floating point: too many significant digitsLaurent MANCHON
| +- Re: floating point: too many significant digitsJanis Papanagnou
| +* Re: floating point: too many significant digitsBen Bacarisse
| |`* Re: floating point: too many significant digitsLaurent MANCHON
| | `* Re: floating point: too many significant digitsJanis Papanagnou
| |  `* Re: floating point: too many significant digitsLaurent MANCHON
| |   +- Re: floating point: too many significant digitsJanis Papanagnou
| |   `- Re: floating point: too many significant digitsJ Naman
| `* Re: floating point: too many significant digitsMarkus Gnam
|  `- Re: floating point: too many significant digitsLaurent MANCHON
`- Re: floating point: too many significant digitsKaz Kylheku

1
floating point: too many significant digits

<826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=939&group=comp.lang.awk#939

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:6214:506:: with SMTP id v6mr3187888qvw.52.1633609453060;
Thu, 07 Oct 2021 05:24:13 -0700 (PDT)
X-Received: by 2002:a25:d94d:: with SMTP id q74mr4328676ybg.196.1633609452753;
Thu, 07 Oct 2021 05:24:12 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Thu, 7 Oct 2021 05:24:12 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=194.167.33.174; posting-account=Wnk9kAoAAABSznUr8dglNh2B_-ufcnK7
NNTP-Posting-Host: 194.167.33.174
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
Subject: floating point: too many significant digits
From: manchon.lm@gmail.com (Laurent MANCHON)
Injection-Date: Thu, 07 Oct 2021 12:24:13 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: Laurent MANCHON - Thu, 7 Oct 2021 12:24 UTC

--Hi,

TAWK (v6.7) display warning with more than 14 digits:

awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
awk: warning in program line 1: floating point: too many significant digits
1.92248321

Re: floating point: too many significant digits

<fafd7492-5104-4924-9cfa-445dcb53e5ffn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=940&group=comp.lang.awk#940

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:ad4:42c8:: with SMTP id f8mr7786279qvr.58.1633661953646;
Thu, 07 Oct 2021 19:59:13 -0700 (PDT)
X-Received: by 2002:a25:5244:: with SMTP id g65mr772050ybb.464.1633661953283;
Thu, 07 Oct 2021 19:59:13 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Thu, 7 Oct 2021 19:59:13 -0700 (PDT)
In-Reply-To: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=96.255.232.150; posting-account=BcR7vAoAAABY9YgIIYIhD68t7wwjMvJW
NNTP-Posting-Host: 96.255.232.150
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fafd7492-5104-4924-9cfa-445dcb53e5ffn@googlegroups.com>
Subject: Re: floating point: too many significant digits
From: jnaman2@gmail.com (J Naman)
Injection-Date: Fri, 08 Oct 2021 02:59:13 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 12
 by: J Naman - Fri, 8 Oct 2021 02:59 UTC

On Thursday, 7 October 2021 at 08:24:13 UTC-4, manch...@gmail.com wrote:
> --Hi,
>
> TAWK (v6.7) display warning with more than 14 digits:
>
> awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
> awk: warning in program line 1: floating point: too many significant digits
> 1.92248321
Have you tried coding constants as strings, which will be converted to f.p. by gawk|tawk|mawk|awk?
pi_str="3.14159265358979323846264338327950288419716939937510"; # 50 decimal digits
var="1.9224832057952844"; # ???
I do not know anything about TAWK beyond Ver 5, which was 32-bit, but I don't remember any warning such as you got.
Maybe consider switching to one of the *awk's that are up-to-date?

Re: floating point: too many significant digits

<ffd6f940-c04a-467e-8110-5fe890455a77n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=941&group=comp.lang.awk#941

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:ae9:e887:: with SMTP id a129mr1421997qkg.81.1633674772160;
Thu, 07 Oct 2021 23:32:52 -0700 (PDT)
X-Received: by 2002:a25:384e:: with SMTP id f75mr1577541yba.137.1633674771934;
Thu, 07 Oct 2021 23:32:51 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Thu, 7 Oct 2021 23:32:51 -0700 (PDT)
In-Reply-To: <fafd7492-5104-4924-9cfa-445dcb53e5ffn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=194.167.33.174; posting-account=Wnk9kAoAAABSznUr8dglNh2B_-ufcnK7
NNTP-Posting-Host: 194.167.33.174
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com> <fafd7492-5104-4924-9cfa-445dcb53e5ffn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ffd6f940-c04a-467e-8110-5fe890455a77n@googlegroups.com>
Subject: Re: floating point: too many significant digits
From: manchon.lm@gmail.com (Laurent MANCHON)
Injection-Date: Fri, 08 Oct 2021 06:32:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Laurent MANCHON - Fri, 8 Oct 2021 06:32 UTC

nothing change:
awkw "BEGIN{var=sprintf(\"%.8f\","3.14159265358979323846264338327950288419716939937510");print var; exit 1}"
awk: warning in program line 1: floating point: too many significant digits
3.14159265

strange behaviour, and it doesn't occur with traditional awk, maybe a bug in coding long float

Le vendredi 8 octobre 2021 à 04:59:14 UTC+2, jna...@gmail.com a écrit :
> On Thursday, 7 October 2021 at 08:24:13 UTC-4, manch...@gmail.com wrote:
> > --Hi,
> >
> > TAWK (v6.7) display warning with more than 14 digits:
> >
> > awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
> > awk: warning in program line 1: floating point: too many significant digits
> > 1.92248321
> Have you tried coding constants as strings, which will be converted to f.p. by gawk|tawk|mawk|awk?
> pi_str="3.14159265358979323846264338327950288419716939937510"; # 50 decimal digits
> var="1.9224832057952844"; # ???
> I do not know anything about TAWK beyond Ver 5, which was 32-bit, but I don't remember any warning such as you got.
> Maybe consider switching to one of the *awk's that are up-to-date?

Re: floating point: too many significant digits

<sjoqel$tc5$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=942&group=comp.lang.awk#942

  copy link   Newsgroups: comp.lang.awk
Path: rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: floating point: too many significant digits
Date: Fri, 8 Oct 2021 09:02:44 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <sjoqel$tc5$1@dont-email.me>
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Oct 2021 07:02:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="69a8d5f1aff5da6a309b0977b9e323cc";
logging-data="30085"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Bww7FnY4cH8wUQtPkLcZ7"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:cgjwT59k6bg4nMrwi2h+7ODiC1s=
In-Reply-To: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
 by: Janis Papanagnou - Fri, 8 Oct 2021 07:02 UTC

On 07.10.2021 14:24, Laurent MANCHON wrote:
> --Hi,
>
> TAWK (v6.7) display warning with more than 14 digits:
>
> awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
> awk: warning in program line 1: floating point: too many significant digits
> 1.92248321

And what is your question or problem? Or do you just want to inform us
about that nice and useful tawk feature to get a warning?

Janis

PS: Don't top-post!

Re: floating point: too many significant digits

<9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=943&group=comp.lang.awk#943

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a37:8ec6:: with SMTP id q189mr1717074qkd.145.1633681348101;
Fri, 08 Oct 2021 01:22:28 -0700 (PDT)
X-Received: by 2002:a25:d251:: with SMTP id j78mr1834240ybg.185.1633681347764;
Fri, 08 Oct 2021 01:22:27 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Fri, 8 Oct 2021 01:22:27 -0700 (PDT)
In-Reply-To: <sjoqel$tc5$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=194.167.33.174; posting-account=Wnk9kAoAAABSznUr8dglNh2B_-ufcnK7
NNTP-Posting-Host: 194.167.33.174
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com> <sjoqel$tc5$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
Subject: Re: floating point: too many significant digits
From: manchon.lm@gmail.com (Laurent MANCHON)
Injection-Date: Fri, 08 Oct 2021 08:22:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 22
 by: Laurent MANCHON - Fri, 8 Oct 2021 08:22 UTC

Le vendredi 8 octobre 2021 à 09:02:46 UTC+2, Janis Papanagnou a écrit :
> On 07.10.2021 14:24, Laurent MANCHON wrote:
> > --Hi,
> >
> > TAWK (v6.7) display warning with more than 14 digits:
> >
> > awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
> > awk: warning in program line 1: floating point: too many significant digits
> > 1.92248321
> And what is your question or problem? Or do you just want to inform us
> about that nice and useful tawk feature to get a warning?
>
> Janis
>
> PS: Don't top-post!

just to say: Why this warning message ?
when you have a file with millions of big floating numbers, TAWK print this message !
Is there an option or parameter to avoid this warning ?

Re: floating point: too many significant digits

<sjp2jp$h3m$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=944&group=comp.lang.awk#944

  copy link   Newsgroups: comp.lang.awk
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: floating point: too many significant digits
Date: Fri, 8 Oct 2021 11:22:00 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <sjp2jp$h3m$1@dont-email.me>
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
<sjoqel$tc5$1@dont-email.me>
<9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 8 Oct 2021 09:22:01 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="69a8d5f1aff5da6a309b0977b9e323cc";
logging-data="17526"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PGRPrMzIgfnPm4nfja5zH"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:7B72LCZEPX9LHwuN3oxCC9F/gZM=
In-Reply-To: <9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Fri, 8 Oct 2021 09:22 UTC

On 08.10.2021 10:22, Laurent MANCHON wrote:
> Le vendredi 8 octobre 2021 à 09:02:46 UTC+2, Janis Papanagnou a écrit :
>> On 07.10.2021 14:24, Laurent MANCHON wrote:
>>> --Hi,
>>>
>>> TAWK (v6.7) display warning with more than 14 digits:
>>>
>>> awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
>>> awk: warning in program line 1: floating point: too many significant digits
>>> 1.92248321
>> And what is your question or problem? Or do you just want to inform us
>> about that nice and useful tawk feature to get a warning?
>>
>> Janis
>>
>> PS: Don't top-post!
>
> just to say: Why this warning message ?

Just as an educated guess; if a user explicitly specifies many digits
he may intend to do arithmetics with such a high accuracy, but if the
underlying data type doesn't support that accuracy he may get numbers
with digits at the far end that are effectively just random. Say, you
calculate pi and get 3.141592653198765465133 the result is useless or
misleading because only the leading digits are correct.

> when you have a file with millions of big floating numbers, TAWK print this message !
> Is there an option or parameter to avoid this warning ?

That question should be answered by the Tawk manual or man page.

Practically, if suppressing the message is not possible, you may try
to redirect the output channel (standard error?) where the message is
created (and hopefully it's not the same as the standard output where
regular output is placed). Another workaround is to read that value as
string and strip the data string after the supported number of digits
before converting it to a number or using it in arithmetic expressions.

Ideally it should be possible to activate (and suppress) individual
warning messages as desired in Awks.

Janis

Re: floating point: too many significant digits

<87bl3zdfcl.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=945&group=comp.lang.awk#945

  copy link   Newsgroups: comp.lang.awk
Path: rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.awk
Subject: Re: floating point: too many significant digits
Date: Fri, 08 Oct 2021 10:40:26 +0100
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <87bl3zdfcl.fsf@bsb.me.uk>
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
<sjoqel$tc5$1@dont-email.me>
<9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="2b3fe689dcdd84d60d847c36de22a538";
logging-data="18022"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QN5uoWZ+TQb76bAvc/tvhfCsoBMSdK0Y="
Cancel-Lock: sha1:fDpn9ZcyVsha77SwWMfmLG7Vspw=
sha1:0v5qHNMuKWxLIQpMva9LKxY2MoY=
X-BSB-Auth: 1.52d5e7abcc99e78733a6.20211008104026BST.87bl3zdfcl.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 8 Oct 2021 09:40 UTC

Laurent MANCHON <manchon.lm@gmail.com> writes:

> Le vendredi 8 octobre 2021 à 09:02:46 UTC+2, Janis Papanagnou a écrit :
>> On 07.10.2021 14:24, Laurent MANCHON wrote:
>> > --Hi,
>> >
>> > TAWK (v6.7) display warning with more than 14 digits:
>> >
>> > awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
>> > awk: warning in program line 1: floating point: too many significant digits
>> > 1.92248321
>> And what is your question or problem? Or do you just want to inform us
>> about that nice and useful tawk feature to get a warning?

> just to say: Why this warning message ?
> when you have a file with millions of big floating numbers, TAWK print
> this message !

Does it happen when processing input? If so, I can see how it would be
very annoying.

> Is there an option or parameter to avoid this warning ?

I don't know much about tawk, but I do know it's old an unmaintained.
Are you committed to using that version of awk? If not, this warning
could be the prompt you need to switch to a maintained version...

--
Ben.

Re: floating point: too many significant digits

<48d42479-5caa-4cf2-9a44-a8b1655279bdn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=946&group=comp.lang.awk#946

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a37:64ca:: with SMTP id y193mr1875216qkb.491.1633686314148;
Fri, 08 Oct 2021 02:45:14 -0700 (PDT)
X-Received: by 2002:a25:b309:: with SMTP id l9mr2347315ybj.188.1633686313825;
Fri, 08 Oct 2021 02:45:13 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Fri, 8 Oct 2021 02:45:13 -0700 (PDT)
In-Reply-To: <87bl3zdfcl.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=194.167.33.174; posting-account=Wnk9kAoAAABSznUr8dglNh2B_-ufcnK7
NNTP-Posting-Host: 194.167.33.174
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
<sjoqel$tc5$1@dont-email.me> <9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
<87bl3zdfcl.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <48d42479-5caa-4cf2-9a44-a8b1655279bdn@googlegroups.com>
Subject: Re: floating point: too many significant digits
From: manchon.lm@gmail.com (Laurent MANCHON)
Injection-Date: Fri, 08 Oct 2021 09:45:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 52
 by: Laurent MANCHON - Fri, 8 Oct 2021 09:45 UTC

Le vendredi 8 octobre 2021 à 11:40:27 UTC+2, Ben Bacarisse a écrit :
> Laurent MANCHON <manch...@gmail.com> writes:
>
> > Le vendredi 8 octobre 2021 à 09:02:46 UTC+2, Janis Papanagnou a écrit :
> >> On 07.10.2021 14:24, Laurent MANCHON wrote:
> >> > --Hi,
> >> >
> >> > TAWK (v6.7) display warning with more than 14 digits:
> >> >
> >> > awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
> >> > awk: warning in program line 1: floating point: too many significant digits
> >> > 1.92248321
> >> And what is your question or problem? Or do you just want to inform us
> >> about that nice and useful tawk feature to get a warning?
> > just to say: Why this warning message ?
> > when you have a file with millions of big floating numbers, TAWK print
> > this message !
> Does it happen when processing input? If so, I can see how it would be
> very annoying.

yes, try to put this list of numbers in a file and try to print them:
1.941359281539914
1.965880632400514
1.977476954460144
2.168184041976924
2.213710546493534
1.984231114387514
1.944460153579714
2.156220912933344
1.908116817474364
1.963439345359804
2.109183073043824
1.921808719635004
2.107269763946534
2.151268005371094
1.991624832153324

> > Is there an option or parameter to avoid this warning ?
> I don't know much about tawk, but I do know it's old an unmaintained.
> Are you committed to using that version of awk? If not, this warning
> could be the prompt you need to switch to a maintained version...

with traditional *awk this warning never occurs
>
> --
> Ben.

Re: floating point: too many significant digits

<sjp51a$1gg$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=947&group=comp.lang.awk#947

  copy link   Newsgroups: comp.lang.awk
Path: rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: floating point: too many significant digits
Date: Fri, 8 Oct 2021 12:03:21 +0200
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <sjp51a$1gg$1@dont-email.me>
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
<sjoqel$tc5$1@dont-email.me>
<9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
<87bl3zdfcl.fsf@bsb.me.uk>
<48d42479-5caa-4cf2-9a44-a8b1655279bdn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 8 Oct 2021 10:03:22 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="69a8d5f1aff5da6a309b0977b9e323cc";
logging-data="1552"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18W1ucl4uFBLCIzZ5N/RWH2"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:JIuYAot3Yy9DNy0vjRwNFB/+Bok=
In-Reply-To: <48d42479-5caa-4cf2-9a44-a8b1655279bdn@googlegroups.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Fri, 8 Oct 2021 10:03 UTC

On 08.10.2021 11:45, Laurent MANCHON wrote:
> Le vendredi 8 octobre 2021 à 11:40:27 UTC+2, Ben Bacarisse a écrit :
>> Does it happen when processing input? If so, I can see how it would be
>> very annoying.
>
> yes, try to put this list of numbers in a file and try to print them:
> 1.941359281539914
> 1.965880632400514
> [...]

On which platform are you working? If you are on some Unix system I'd
try

1) redirecting stderr (hoping the warning message uses that channel)

tawk '...' a_file 2>/dev/null

2) stripping the input data to the supported accuracy, say, using a
string length of only 8

cut -c -8 < a_file | tawk '...'

3) using (as suggested by Ben) another Awk (here GNU Awk)

gawk '...' a_file

Janis

Re: floating point: too many significant digits

<fd720ea8-fb03-4b0c-a20b-b375ee71cdb2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=948&group=comp.lang.awk#948

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:ac8:4410:: with SMTP id j16mr10314526qtn.195.1633687809614;
Fri, 08 Oct 2021 03:10:09 -0700 (PDT)
X-Received: by 2002:a25:ac61:: with SMTP id r33mr2356457ybd.342.1633687809261;
Fri, 08 Oct 2021 03:10:09 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Fri, 8 Oct 2021 03:10:08 -0700 (PDT)
In-Reply-To: <sjp51a$1gg$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=194.167.33.174; posting-account=Wnk9kAoAAABSznUr8dglNh2B_-ufcnK7
NNTP-Posting-Host: 194.167.33.174
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
<sjoqel$tc5$1@dont-email.me> <9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
<87bl3zdfcl.fsf@bsb.me.uk> <48d42479-5caa-4cf2-9a44-a8b1655279bdn@googlegroups.com>
<sjp51a$1gg$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <fd720ea8-fb03-4b0c-a20b-b375ee71cdb2n@googlegroups.com>
Subject: Re: floating point: too many significant digits
From: manchon.lm@gmail.com (Laurent MANCHON)
Injection-Date: Fri, 08 Oct 2021 10:10:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 36
 by: Laurent MANCHON - Fri, 8 Oct 2021 10:10 UTC

Le vendredi 8 octobre 2021 à 12:03:23 UTC+2, Janis Papanagnou a écrit :
> On 08.10.2021 11:45, Laurent MANCHON wrote:
> > Le vendredi 8 octobre 2021 à 11:40:27 UTC+2, Ben Bacarisse a écrit :
> >> Does it happen when processing input? If so, I can see how it would be
> >> very annoying.
> >
> > yes, try to put this list of numbers in a file and try to print them:
> > 1.941359281539914
> > 1.965880632400514
> > [...]
>
> On which platform are you working? If you are on some Unix system I'd
> try
>
> 1) redirecting stderr (hoping the warning message uses that channel)
>
> tawk '...' a_file 2>/dev/null
>
> 2) stripping the input data to the supported accuracy, say, using a
> string length of only 8
>
> cut -c -8 < a_file | tawk '...'
>
> 3) using (as suggested by Ben) another Awk (here GNU Awk)
>
> gawk '...' a_file
>
>
> Janis

i work on windows
I got around the problem as suggested by using: $1=substr($1,1,10)

Re: floating point: too many significant digits

<sjplto$oti$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=949&group=comp.lang.awk#949

  copy link   Newsgroups: comp.lang.awk
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: floating point: too many significant digits
Date: Fri, 8 Oct 2021 16:51:35 +0200
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <sjplto$oti$1@dont-email.me>
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
<sjoqel$tc5$1@dont-email.me>
<9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
<87bl3zdfcl.fsf@bsb.me.uk>
<48d42479-5caa-4cf2-9a44-a8b1655279bdn@googlegroups.com>
<sjp51a$1gg$1@dont-email.me>
<fd720ea8-fb03-4b0c-a20b-b375ee71cdb2n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 8 Oct 2021 14:51:36 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="69a8d5f1aff5da6a309b0977b9e323cc";
logging-data="25522"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+752H1azAlci6dAHCo/WuQ"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:8eqrcI97wnfvKSv9c8qfy74MwbQ=
In-Reply-To: <fd720ea8-fb03-4b0c-a20b-b375ee71cdb2n@googlegroups.com>
 by: Janis Papanagnou - Fri, 8 Oct 2021 14:51 UTC

On 08.10.2021 12:10, Laurent MANCHON wrote:
>
> I got around the problem as suggested by using: $1=substr($1,1,10)

That means the warning message appears not when the data is read in
but later when it is processed. Good. Glad the workaround helped.

Janis

Re: floating point: too many significant digits

<20211008074612.541@kylheku.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=950&group=comp.lang.awk#950

  copy link   Newsgroups: comp.lang.awk
Path: rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: 480-992-1380@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.awk
Subject: Re: floating point: too many significant digits
Date: Fri, 8 Oct 2021 14:52:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <20211008074612.541@kylheku.com>
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
Injection-Date: Fri, 8 Oct 2021 14:52:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7dc6280dc40d9a2da688a16b7a6ccf47";
logging-data="19298"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Urk4qKk1X+ohy6EUJTD8FBU4ilEMPZUs="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:p554FvEwSnE6L6/O/Wm4G443H2U=
 by: Kaz Kylheku - Fri, 8 Oct 2021 14:52 UTC

On 2021-10-07, Laurent MANCHON <manchon.lm@gmail.com> wrote:
> --Hi,
>
> TAWK (v6.7) display warning with more than 14 digits:
>
> awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
> awk: warning in program line 1: floating point: too many significant digits
> 1.92248321

Your 17-digit value 1.9224832057952844 is not the result of converting
any IEEE 754 64 bit double to decimal.

When this value is converted to double, and then back to 17 decimal
digits, the reprsentation 1.9224832057952843 is produced.

If tawk does not warn about 1.9224832057952843, then that is the
issue. Just the wording of the diagnostic is poor.

A 64 bit double has two properties, in relation to decimal
representations:

- it can store up to 15 decimal digits of mantissa precision.
If more decimal digits are specified, some of them may be changed
or truncated away.

- 17 decimal digits are required to exactly specify/preserve
a double's value in decimal form.

A programming language must accept up to 17 digits in a constant
without complaining, otherwise it becomes a nuisance to those who
need to specify an exact number down to the last mantissa bit.

However, not all 17 digit numbers are distinct.

The 64 bit double type contains a value which is very close to
1.9224832057952843. The next one (next one bit increment in the
mantissa) rounds to 1.9224832057952845.

The constant 1.9224832057952844 is ambiguous: it isn't clear
which of those two points you want to specify.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: floating point: too many significant digits

<72e84855-ecde-412d-9647-a4437f82e990n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=951&group=comp.lang.awk#951

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a37:9e4b:: with SMTP id h72mr8112543qke.475.1633800774974;
Sat, 09 Oct 2021 10:32:54 -0700 (PDT)
X-Received: by 2002:a25:ac61:: with SMTP id r33mr10305880ybd.342.1633800774670;
Sat, 09 Oct 2021 10:32:54 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sat, 9 Oct 2021 10:32:54 -0700 (PDT)
In-Reply-To: <fd720ea8-fb03-4b0c-a20b-b375ee71cdb2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=96.255.232.150; posting-account=BcR7vAoAAABY9YgIIYIhD68t7wwjMvJW
NNTP-Posting-Host: 96.255.232.150
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
<sjoqel$tc5$1@dont-email.me> <9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
<87bl3zdfcl.fsf@bsb.me.uk> <48d42479-5caa-4cf2-9a44-a8b1655279bdn@googlegroups.com>
<sjp51a$1gg$1@dont-email.me> <fd720ea8-fb03-4b0c-a20b-b375ee71cdb2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <72e84855-ecde-412d-9647-a4437f82e990n@googlegroups.com>
Subject: Re: floating point: too many significant digits
From: jnaman2@gmail.com (J Naman)
Injection-Date: Sat, 09 Oct 2021 17:32:54 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 39
 by: J Naman - Sat, 9 Oct 2021 17:32 UTC

On Friday, 8 October 2021 at 06:10:10 UTC-4, manch...@gmail.com wrote:
> Le vendredi 8 octobre 2021 à 12:03:23 UTC+2, Janis Papanagnou a écrit :
> > On 08.10.2021 11:45, Laurent MANCHON wrote:
> > > Le vendredi 8 octobre 2021 à 11:40:27 UTC+2, Ben Bacarisse a écrit :
> > >> Does it happen when processing input? If so, I can see how it would be
> > >> very annoying.
> > >
> > > yes, try to put this list of numbers in a file and try to print them:
> > > 1.941359281539914
> > > 1.965880632400514
> > > [...]
> >
> > On which platform are you working? If you are on some Unix system I'd
> > try
> >
> > 1) redirecting stderr (hoping the warning message uses that channel)
> >
> > tawk '...' a_file 2>/dev/null
> >
> > 2) stripping the input data to the supported accuracy, say, using a
> > string length of only 8
> >
> > cut -c -8 < a_file | tawk '...'
> >
> > 3) using (as suggested by Ben) another Awk (here GNU Awk)
> >
> > gawk '...' a_file
> >
> >
> > Janis
> i work on windows
> I got around the problem as suggested by using: $1=substr($1,1,10)
If you are VERY particular, consider d11=substr($1,11,1), examine it and decide if you need to round up, then possibly add 1, such as: d10=substr($1,10,1)+(d11>4); THEN $1=substr($1,1,9) d10;

Re: floating point: too many significant digits

<5ca7c3b3-d3f7-4522-b3bb-87795d56664en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=952&group=comp.lang.awk#952

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a37:5d8:: with SMTP id 207mr12441408qkf.277.1633896924247;
Sun, 10 Oct 2021 13:15:24 -0700 (PDT)
X-Received: by 2002:a25:d251:: with SMTP id j78mr15979658ybg.185.1633896924082;
Sun, 10 Oct 2021 13:15:24 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sun, 10 Oct 2021 13:15:23 -0700 (PDT)
In-Reply-To: <9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=95.112.219.253; posting-account=cEiGhAoAAADawfzHNvHkj7SiP-YphKfZ
NNTP-Posting-Host: 95.112.219.253
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
<sjoqel$tc5$1@dont-email.me> <9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5ca7c3b3-d3f7-4522-b3bb-87795d56664en@googlegroups.com>
Subject: Re: floating point: too many significant digits
From: markus.gnam@gmail.com (Markus Gnam)
Injection-Date: Sun, 10 Oct 2021 20:15:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 33
 by: Markus Gnam - Sun, 10 Oct 2021 20:15 UTC

> Le vendredi 8 octobre 2021 à 09:02:46 UTC+2, Janis Papanagnou a écrit :
> > On 07.10.2021 14:24, Laurent MANCHON wrote:
> > > --Hi,
> > >
> > > TAWK (v6.7) display warning with more than 14 digits:
> > >
> > > awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
> > > awk: warning in program line 1: floating point: too many significant digits
> > > 1.92248321
> > And what is your question or problem? Or do you just want to inform us
> > about that nice and useful tawk feature to get a warning?
> >
> > Janis
> >
> > PS: Don't top-post!
> just to say: Why this warning message ?
> when you have a file with millions of big floating numbers, TAWK print this message !
> Is there an option or parameter to avoid this warning ?

You can turn off the "too many significant digits" message with the FLOATMASK variable only for a *string* being converted to a float, see TAWK 5 manual page 200:

BEGIN {
FLOATMASK = and(FLOATMASK,not(0x400))
var = "1.9224832057952844"
printf("%.8f",var)
}

=> 1.92248321

Re: floating point: too many significant digits

<d29a736d-7f5f-462c-81c2-bc4005707eb4n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=954&group=comp.lang.awk#954

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:6214:98d:: with SMTP id dt13mr22181256qvb.13.1633934938351;
Sun, 10 Oct 2021 23:48:58 -0700 (PDT)
X-Received: by 2002:a25:c644:: with SMTP id k65mr11269770ybf.191.1633934938190;
Sun, 10 Oct 2021 23:48:58 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sun, 10 Oct 2021 23:48:57 -0700 (PDT)
In-Reply-To: <5ca7c3b3-d3f7-4522-b3bb-87795d56664en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=194.167.33.174; posting-account=Wnk9kAoAAABSznUr8dglNh2B_-ufcnK7
NNTP-Posting-Host: 194.167.33.174
References: <826700c3-d2d5-475f-8885-aff108417f87n@googlegroups.com>
<sjoqel$tc5$1@dont-email.me> <9e6c0b33-f5d4-4da2-9474-9a082e47c3adn@googlegroups.com>
<5ca7c3b3-d3f7-4522-b3bb-87795d56664en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d29a736d-7f5f-462c-81c2-bc4005707eb4n@googlegroups.com>
Subject: Re: floating point: too many significant digits
From: manchon.lm@gmail.com (Laurent MANCHON)
Injection-Date: Mon, 11 Oct 2021 06:48:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 51
 by: Laurent MANCHON - Mon, 11 Oct 2021 06:48 UTC

Le dimanche 10 octobre 2021 à 22:15:24 UTC+2, Markus Gnam a écrit :
> > Le vendredi 8 octobre 2021 à 09:02:46 UTC+2, Janis Papanagnou a écrit :
> > > On 07.10.2021 14:24, Laurent MANCHON wrote:
> > > > --Hi,
> > > >
> > > > TAWK (v6.7) display warning with more than 14 digits:
> > > >
> > > > awkw "BEGIN{var=1.9224832057952844;printf("%.8f",var);exit}"
> > > > awk: warning in program line 1: floating point: too many significant digits
> > > > 1.92248321
> > > And what is your question or problem? Or do you just want to inform us
> > > about that nice and useful tawk feature to get a warning?
> > >
> > > Janis
> > >
> > > PS: Don't top-post!
> > just to say: Why this warning message ?
> > when you have a file with millions of big floating numbers, TAWK print this message !
> > Is there an option or parameter to avoid this warning ?
> You can turn off the "too many significant digits" message with the FLOATMASK variable only for a *string* being converted to a float, see TAWK 5 manual page 200:
>
> BEGIN {
> FLOATMASK = and(FLOATMASK,not(0x400))
> var = "1.9224832057952844"
> printf("%.8f",var)
> }
>
> => 1.92248321

to Kaz:
awkw "BEGIN{var=\"1.9224832057952843\";printf(\"%.8f\n\",var);exit 1}"
awk: warning in program(line 1) (NR=0):
floating point: too many significant digits
1.92248321

1.9224832057952843 is a right representation of decimal, so it is not an issue.

now with:
awkw "BEGIN{FLOATMASK = and(FLOATMASK,not(0x400));var=\"1.9224832057952843\";printf(\"%.8f\n\",var);exit 1}"

it works fine, this is a good issue, thank you Markus.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor