Groups | Search | Server Info | Login | Register


Groups > comp.lang.pascal.borland > #133

Re: longint and/or overflow bug?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!.POSTED!not-for-mail
From Marco van de Voort <marcov@toad.stack.nl>
Newsgroups comp.lang.pascal.borland
Subject Re: longint and/or overflow bug?
Date Wed, 31 Oct 2012 10:11:49 +0000 (UTC)
Organization Stack Usenet News Service
Lines 23
Message-ID <slrnk91ub5.1j6f.marcov@toad.stack.nl> (permalink)
References <a3cac83f-4bb6-46ae-a9ab-70a7c0d73e5d@s18g2000yqh.googlegroups.com> <slrnk91s66.1ddn.marcov@toad.stack.nl>
NNTP-Posting-Host toad.stack.nl
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace mud.stack.nl 1351678309 68201 2001:610:1108:5010::135 (31 Oct 2012 10:11:49 GMT)
X-Complaints-To abuse@stack.nl
NNTP-Posting-Date Wed, 31 Oct 2012 10:11:49 +0000 (UTC)
User-Agent slrn/0.9.9p1 (FreeBSD)
Xref csiph.com comp.lang.pascal.borland:133

Show key headers only | View raw


On 2012-10-31, Marco van de Voort <marcov@toad.stack.nl> wrote:
> On 2012-10-30, Jim Leonard <mobygamer@gmail.com> wrote:
>>
>> var
>>   l:longint;
>>   w1,w2:word;
>>
>> begin
>>   w1:=val1; w2:=val2;
>>   l:=w1 * w2; {Throws runtime 215 "arithmetic overflow" if $Q+}
>
> typing:
> longint :=word * word

> Pascal rule is afaik that an expression is evaluated in (at least?) the
> combined range of the operands.  Which is word.

Hmm, thinking of it, in Pascal the above is impossible, since range(word)
is not a subset of range(integer). Those are special yet again.

Still the behaviour is normal and consistent in the Borland lines and
compatibles.

Back to comp.lang.pascal.borland | Previous | NextPrevious in thread | Find similar


Thread

longint and/or overflow bug? Jim Leonard <mobygamer@gmail.com> - 2012-10-30 08:56 -0700
  Re: longint and/or overflow bug? Vinzent Höfler <0439279208b62c95f1880bf0f8776eeb@t-domaingrabbing.de> - 2012-10-30 18:18 +0100
    Re: longint and/or overflow bug? Jim Leonard <mobygamer@gmail.com> - 2012-10-30 12:31 -0700
      Re: longint and/or overflow bug? rugxulo@gmail.com - 2012-10-30 14:50 -0700
  Re: longint and/or overflow bug? Marco van de Voort <marcov@toad.stack.nl> - 2012-10-31 09:35 +0000
    Re: longint and/or overflow bug? Marco van de Voort <marcov@toad.stack.nl> - 2012-10-31 10:11 +0000

csiph-web