Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

word to int64 bug (delphi6)

9 views
Skip to first unread message

nmm

unread,
Nov 29, 2007, 9:20:57 AM11/29/07
to
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

Rudy Velthuis

unread,
Jan 1, 2008, 3:42:48 PM1/1/08
to
nmm wrote:

You posted to a group which, on the original server does not exits
anymore. Please be sure to post to the newsgroups.borland.com server,
and not to news.online.de. Hardly anyone will see your post, here (I
only saw it because I was looking for such orphaned groups).

Please post to
news://newsgroups.borland.com/borland.public.delphi.language.delphi.win3
2 instead (careful for the wrap).

--
Rudy Velthuis http://rvelthuis.de

"Imitation is the sincerest form of television."
-- Fred Allen (1894-1956)

0 new messages