🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #11370

Unexpected Overflow in TeX

#11370
From: Julio Sanchez
Date: Wed, 28 Feb 1990 17:37
42 lines
1752 bytes
The following TeX program bombs with arithmetic overflow:

\newcount\total
\total=1
\loop
\iftrue
\multiply\total by 2
\immediate\write16{\number\total}
\repeat
\bye

Now, the problem is that it bombs too soon. Acoording to the TeXbook,
page 118, overflow happens when the result exceeds the register
capability. Same page also says that the \count registers capability
is -2147483647 to 2147483647.

I have tried it on both Sun TeX (2.9) and on VAX/VMS TeX (some older
version). Also the following code bombs:

\newcount\total
\total=1234567890
\divide\total by 1000
\multiply\total by 1000
\bye

But it bombs in the multiply, with the funny result that I
cannot put into a register a number that is guaranteed to be
at most as large as a number I have already put into it.

Would some nice soul out there tell me to RTFM (with pointer)
whether it is a bug and which version has it corrected, or
any useful information on this?

Yours puzzled,


Julio Sanchez                            Ph. +34 1 534 30 04
Grupo de Mecanica del Vuelo, S.A. (GMV)  Fax +34 1 533 32 50
Cristobal Bordiu, 35                     Telex  48487 GMEV E
E-28003 MADRID                           jsanchez@gmv.es
SPAIN                                    mcsun!gmv.es!jsanchez@uunet.uu.net
                                         uunet!mcsun!gmv.es!jsanchez
Technical Details
Message-ID: <1616@colon.gmv.es>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!goya!colon!jjsf

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!goya!colon!jjsf
From: jjsf@gmv.es (Julio Sanchez)
Newsgroups: comp.text.tex
Subject: Unexpected Overflow in TeX
Message-ID: <1616@colon.gmv.es>
Date: 28 Feb 90 17:37:40 GMT
Reply-To: jjsf@colon.UUCP (Julio Sanchez)
Organization: Grupo de Mecanica del Vuelo, S.A. (GMV), Madrid, Spain
Lines: 42