🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.language.objectpascal
Article #170

word to int64 bug (delphi6)

#170
From: nmm
Date: Thu, 29 Nov 2007 14:20
29 lines
1589 bytes
Hi,

if you assign "-" of a word-Variable to an int64 one, you get unexpectet results:

var aWord:word;
    ainteger:integer;
    AInt64:int64;
begin
    aWord:=2;
    aInteger:=2;
    AInt64:=-aWord;
    writeln(inttostr(AInt64)); //you get 4294967294 instead of -2

    AInt64:=0-aWord;
    writeln(inttostr(AInt64)); //-2

    AInt64:=-int64(aWord);
    writeln(inttostr(AInt64)); //-2

    AInt64:=-aInteger;
    writeln(inttostr(AInt64)); //-2
end.

I suppose this to be a bug in Delphi 6.

Is this still there in Delphi 2007,2008,...?

Regards
M.Malarski
Technical Details
Message-ID: <fimhs8$2mp$1@online.de>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 109d30,bbeb2cbde41e85ee,start
X-Google-Attributes: gid109d30,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail
From: nmm <Mircea.Malarski@onlinehome.de>
Newsgroups: borland.public.delphi.language.objectpascal
Subject: word to int64 bug (delphi6)
Date: Thu, 29 Nov 2007 15:20:57 +0100
Organization: 1&1 Internet AG
Lines: 29
Message-ID: <fimhs8$2mp$1@online.de>
NNTP-Posting-Host: p54b89253.dip0.t-ipconnect.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit
X-Trace: online.de 1196346056 2777 84.184.146.83 (29 Nov 2007 14:20:56 GMT)
X-Complaints-To: abuse@einsundeins.com
NNTP-Posting-Date: Thu, 29 Nov 2007 14:20:56 +0000 (UTC)
User-Agent: Thunderbird 1.5.0.7 (Windows/20060909)
X-Enigmail-Version: 0.94.1.2