🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.borland
Article #283

Re: RTE200 - not Delay!

#283
From: Horst Kraemer
Date: Mon, 14 Jun 1999 00:00
25 lines
1198 bytes
On Mon, 14 Jun 1999 14:43:42 GMT, Robert AH Prins
<prinsra@williscorroon.com> wrote:

> const
>   a: longint = $80000000;
>   b: longint = -1;
> 
> begin
>   writeln(a div b);
> end.
> 
> Any clues as to how to get rid of this one?

You cannot and you shouldn't. It's a normal integer division overflow
because the mathematical result is MAXLONGINT+1 which cannot be
represented by a longint.

Note that this error message occurs only in TP7.0 with a 386+, i.e. if
the division is exectuted directly by a signed dword DIV. With TP 6.0
or TP7.0 with test8086:=0  you get instead the wrong result
-2147483648 = longint($80000000).


Regards
Horst
Technical Details
Message-ID: <376531b3.759591725@news.snafu.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7k34er$qcn$1@nnrp1.deja.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 108ebd,9ab1c9cdd12e03da
X-Google-Attributes: gid108ebd,public
X-Google-Thread: 111659,9ab1c9cdd12e03da
X-Google-Attributes: gid111659,public
From: horst.kraemer@snafu.de (Horst Kraemer)
Subject: Re: RTE200 - not Delay!
Date: 1999/06/14
Message-ID: <376531b3.759591725@news.snafu.de>
X-Deja-AN: 489549286
References: <7k34er$qcn$1@nnrp1.deja.com>
Organization: [Posted via] Interactive Networx
Newsgroups: comp.lang.pascal.borland,borland.public.turbopascal