<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Bruno Krayenbuhl wrote / napísal(a):
<blockquote cite="mid:F724CD60CB7A411AB474ED5D1157F48E@TOPDDUO"
type="cite">
<meta content="text/html; charset=iso-8859-1"
http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.6001.23588">
<style></style>
<div> </div>
<div>
<div><font face="Arial" size="2">2 - Difference between 2.6.4 on
Win98 and WinXP. </font></div>
<div><font face="Arial" size="2"> I suspect that these 2 are
on different computers and thus do not have exactly the same floating
point unit.</font></div>
</div>
</blockquote>
Yes Win 98 is on PC with Intel Pentium 4 CPU and Win XP on PC with
Intel Core 2 Duo CPU<br>
<br>
But lets look again at our "simplified" program:<br>
=========================<br>
var<br>
c: currency;<br>
i64: int64;<br>
begin<br>
c:=92233720368547;<br>
=========================<br>
Here I stop and let's look at assembler of "c:=92233720368547" :<br>
--------------------------------------<br>
00401543 a1c0204100 mov 0x4120c0,%eax // low 4
bytes; EAX=-859001088 resp. 0xccccaf00 = 3435966208<br>
00401548 a300604100 mov %eax,0x416000<br>
0040154D a1c4204100 mov 0x4120c4,%eax // high 4
bytes; EAX=214748364<br>
00401552 a304604100 mov %eax,0x416004<br>
--------------------------------------<br>
So currency value is: 2^32*214748364 + 3435966208 = 922337200249503744
+ 3435966208 = 922337203685469952<br>
Not as expected 922337203685470000 !<br>
(this is on Win 98 PC !, on Win XP PC are values in EAX correct
3435966256, 214748364)<br>
<br>
So constant "92233720368547" which is part of generated EXE (I think)
is wrong parsed or interpreted or what and stored wrongly in output EXE
file.<br>
But why it happens ? What part of compiler is responsible for parsing
constants in source code and translating them to binary form in which
is stored in output EXE file ?<br>
Does compiler links any external DLLs which probably may change FPU
control word (precision or so) ?<br>
Does compiler first converts value to floating point representation ant
then back to currency or ?<br>
<br>
Thanks<br>
-Laco.<br>
</body>
</html>