Thread View: borland.public.delphi.language.objectpascal
2 messages
2 total messages
Started by nmm
Thu, 29 Nov 2007 14:20
word to int64 bug (delphi6)
Author: nmm
Date: Thu, 29 Nov 2007 14:20
Date: Thu, 29 Nov 2007 14:20
29 lines
1589 bytes
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
Re: word to int64 bug (delphi6)
Author: Rudy Velthuis
Date: Tue, 01 Jan 2008 20:42
Date: Tue, 01 Jan 2008 20:42
16 lines
1798 bytes
1798 bytes
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)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads