Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Good day to deal with people in high places; particularly lonely stewardesses.


comp / comp.lang.tcl / Re: What value can cause this error?

SubjectAuthor
* What value can cause this error?alexandru
`* Re: What value can cause this error?Rich
 `* Re: What value can cause this error?alexandru
  `* Re: What value can cause this error?Rich
   `* Re: What value can cause this error?alexandru
    `* Re: What value can cause this error?Christian Gollwitzer
     `- Re: What value can cause this error?alexandru

1
Subject: What value can cause this error?
From: alexandru
Newsgroups: comp.lang.tcl
Organization: novaBBS
Date: Tue, 17 Sep 2024 21:21 UTC
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: alexandru.dadalau@meshparts.de (alexandru)
Newsgroups: comp.lang.tcl
Subject: What value can cause this error?
Date: Tue, 17 Sep 2024 21:21:27 +0000
Organization: novaBBS
Message-ID: <7fd20d326335042a1fba68d4e0bea337@www.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2448074"; mail-complaints-to="usenet@i2pn2.org";
posting-account="0Z5XV6kwM7Cos/IbgWfXZAYsazigEecpjCfqz3CX7rU";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$gCV3ecTIs3EiQDSMlBD5RetzN1tBc2VRCVupc0pmR9NKvq2FWgyGO
X-Rslight-Posting-User: 916f90664d3de2199c7a6231aba6924e4b1593d3
View all headers

I got this error message from a customer and no further information is
available.
What could have caused this error?

integer value too large to represent
while executing
"expr {round($val*(10.0**($decimals+3)))/(10.0**$decimals)}"

I know that "val" is a proper number and that "decimals" is 6.

I tried to run this expression with very high "val" values and could not
reproduce the error.

Many thanks
Alexandru

Subject: Re: What value can cause this error?
From: Rich
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Tue, 17 Sep 2024 21:49 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: What value can cause this error?
Date: Tue, 17 Sep 2024 21:49:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <vccthq$3n4sm$1@dont-email.me>
References: <7fd20d326335042a1fba68d4e0bea337@www.novabbs.com>
Injection-Date: Tue, 17 Sep 2024 23:49:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ed0ff4f137c23cc34318dac912061eba";
logging-data="3904406"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Xp2DUec8qIiuoGoPITguY"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:sJSSZR4QZK0mlD9Tg6xvxBDc9tI=
View all headers

alexandru <alexandru.dadalau@meshparts.de> wrote:
> I got this error message from a customer and no further information is
> available.
> What could have caused this error?
>
> integer value too large to represent
> while executing
> "expr {round($val*(10.0**($decimals+3)))/(10.0**$decimals)}"
>
> I know that "val" is a proper number and that "decimals" is 6.
>
> I tried to run this expression with very high "val" values and could not
> reproduce the error.

Are you *absolutely* sure that decimals is 6, because I can generate
the error via a smallish change to decimals:

$ rlwrap tclsh
% set val 123
123
% set decimals 999
999
% expr {round($val*(10.0**($decimals+3)))/(10.0**$decimals)}
integer value too large to represent
% set tcl_patchLevel
8.6.12

Subject: Re: What value can cause this error?
From: alexandru
Newsgroups: comp.lang.tcl
Organization: novaBBS
Date: Tue, 17 Sep 2024 23:16 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: alexandru.dadalau@meshparts.de (alexandru)
Newsgroups: comp.lang.tcl
Subject: Re: What value can cause this error?
Date: Tue, 17 Sep 2024 23:16:56 +0000
Organization: novaBBS
Message-ID: <c46c7364fa16219ef4585e3c46918ba7@www.novabbs.com>
References: <7fd20d326335042a1fba68d4e0bea337@www.novabbs.com> <vccthq$3n4sm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2457446"; mail-complaints-to="usenet@i2pn2.org";
posting-account="0Z5XV6kwM7Cos/IbgWfXZAYsazigEecpjCfqz3CX7rU";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$pXAqLnujaSMy/Q0ESu6EB.0SFsdNce61SnlT1Wp3OKLqlOygNVe1m
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: 916f90664d3de2199c7a6231aba6924e4b1593d3
View all headers

Actually yes, I'm sure.
I have the errorInfo that shows the stack of procedure calls.
The procedure is called with "decimals" equal to 6.
The the error is thrown.
The errorInfo does not show the value of variable arguments, so I don't
know that "val" was.
I also checked my source code an all the calls to that procedure never
use higher values than 6 for the second argument.
Here is the complete procedure:

proc NumberReadmm {val {decimals 3}} {
if {![string is double -strict $val]} {
return $val
}
return [expr {round($val*(10.0**($decimals+3)))/(10.0**$decimals)}]mm
}

Here is the errorInfo:

*** ERROR ***
Time: Monday, das 16 von September, 2024, um 13:24:37
integer value too large to represent
while executing
"expr {round($val*(10.0**($decimals+3)))/(10.0**$decimals)}"
(procedure "NumberReadmm" line 5)
invoked from within
"NumberReadmm $contact_offset 6"
(procedure "ContactOffsetFormat" line 7)
invoked from within
"ContactOffsetFormat $contact_offset_min"
(procedure "UIRelationApplyContactOffset" line 45)
invoked from within
"UIRelationApplyContactOffset %W"
invoked from within
".valid.notebook.f5.buttons.b2 invoke "
invoked from within
".valid.notebook.f5.buttons.b2 instate !disabled {
valid.notebook.f5.buttons.b2 invoke } "
invoked from within
".valid.notebook.f5.buttons.b2 instate pressed {
valid.notebook.f5.buttons.b2 state !pressed;
valid.notebook.f5.buttons.b2 instate !disabled { .valid..."
(command bound to event)

Subject: Re: What value can cause this error?
From: Rich
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 18 Sep 2024 00:13 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: What value can cause this error?
Date: Wed, 18 Sep 2024 00:13:34 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <vcd5ve$3oiv0$1@dont-email.me>
References: <7fd20d326335042a1fba68d4e0bea337@www.novabbs.com> <vccthq$3n4sm$1@dont-email.me> <c46c7364fa16219ef4585e3c46918ba7@www.novabbs.com>
Injection-Date: Wed, 18 Sep 2024 02:13:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0bda5e1a8cd4c95fcd371be7d01e2d4c";
logging-data="3951584"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uRecINcbaxjRjJHUu44vj"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:ncH6kkB8Fic+xtsxVx+KMyxi1O0=
View all headers

alexandru <alexandru.dadalau@meshparts.de> wrote:
> Actually yes, I'm sure.
> I have the errorInfo that shows the stack of procedure calls.
> The procedure is called with "decimals" equal to 6.

A very large number in val can also trigger the same error, even with
decimals at 6:

$ rlwrap tclsh
% set decimals 6
6
% set val 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
% expr {round($val*(10.0**($decimals+3)))/(10.0**$decimals)}
integer value too large to represent
%

So if you are certian decimals is 6, then a very large number is
ending up in val somehow.

Subject: Re: What value can cause this error?
From: alexandru
Newsgroups: comp.lang.tcl
Organization: novaBBS
Date: Wed, 18 Sep 2024 10:15 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: alexandru.dadalau@meshparts.de (alexandru)
Newsgroups: comp.lang.tcl
Subject: Re: What value can cause this error?
Date: Wed, 18 Sep 2024 10:15:19 +0000
Organization: novaBBS
Message-ID: <1587302100b35b0029b966b6dfeb7323@www.novabbs.com>
References: <7fd20d326335042a1fba68d4e0bea337@www.novabbs.com> <vccthq$3n4sm$1@dont-email.me> <c46c7364fa16219ef4585e3c46918ba7@www.novabbs.com> <vcd5ve$3oiv0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2510102"; mail-complaints-to="usenet@i2pn2.org";
posting-account="0Z5XV6kwM7Cos/IbgWfXZAYsazigEecpjCfqz3CX7rU";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$Ufc7ORttcNaQqAEMGYmA2u47t44pNcAGGCl8DtHuOagDuvxQsWtPy
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: 916f90664d3de2199c7a6231aba6924e4b1593d3
View all headers

Ok thanks, I did tried very large values, but I gave up trying to early,
as no error came.

Subject: Re: What value can cause this error?
From: Christian Gollwitzer
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 18 Sep 2024 16:06 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: auriocus@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl
Subject: Re: What value can cause this error?
Date: Wed, 18 Sep 2024 18:06:14 +0200
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <vcetpm$48aj$1@dont-email.me>
References: <7fd20d326335042a1fba68d4e0bea337@www.novabbs.com>
<vccthq$3n4sm$1@dont-email.me>
<c46c7364fa16219ef4585e3c46918ba7@www.novabbs.com>
<vcd5ve$3oiv0$1@dont-email.me>
<1587302100b35b0029b966b6dfeb7323@www.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 18 Sep 2024 18:06:15 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fabfc3f21dce2515034578d0ae98ce04";
logging-data="139603"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MdD/t9j6Gq658NrOMUDFAXIl+WkLYFlQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:4aJ0ahG4Z6IVtz2tMbXii0aM8ug=
In-Reply-To: <1587302100b35b0029b966b6dfeb7323@www.novabbs.com>
View all headers

Am 18.09.24 um 12:15 schrieb alexandru:
> Ok thanks, I did tried very large values, but I gave up trying to early,
> as no error came.

You get this for an infinite argumment:

(chris) 69 % expr round(Inf)
integer value too large to represent

Christian

Subject: Re: What value can cause this error?
From: alexandru
Newsgroups: comp.lang.tcl
Organization: novaBBS
Date: Fri, 20 Sep 2024 10:33 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.mixmin.net!news.neodome.net!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: alexandru.dadalau@meshparts.de (alexandru)
Newsgroups: comp.lang.tcl
Subject: Re: What value can cause this error?
Date: Fri, 20 Sep 2024 10:33:14 +0000
Organization: novaBBS
Message-ID: <35b303e3128bd580070b3acb1a79c699@www.novabbs.com>
References: <7fd20d326335042a1fba68d4e0bea337@www.novabbs.com> <vccthq$3n4sm$1@dont-email.me> <c46c7364fa16219ef4585e3c46918ba7@www.novabbs.com> <vcd5ve$3oiv0$1@dont-email.me> <1587302100b35b0029b966b6dfeb7323@www.novabbs.com> <vcetpm$48aj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2752026"; mail-complaints-to="usenet@i2pn2.org";
posting-account="0Z5XV6kwM7Cos/IbgWfXZAYsazigEecpjCfqz3CX7rU";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 916f90664d3de2199c7a6231aba6924e4b1593d3
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$LD2SUEda3F650.UJ6oe0.OWEj8AMzdT4.KPt5Vk9XCd3VVcAkJ1iy
View all headers

Thanks Christian!
I'll implement this check.

1

rocksolid light 0.9.8
clearnet tor