473,508 Members | 2,130 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strange question about double variable initializing.

In the project upgrade from VS2002 to VS2005, all the double variables
are initialize to 0.0000000.

I checked the generated assembly instructions, the codes as below:

double dMinVal = 0.01;
004c83E3 fldz
004c83E9 fstp qword ptr [ebp-58h]

double dMaxVal = 0.99;
004c83EC fldz
004c83F2 fstp qword ptr [ebp-68h]
but if I compile every cpp file one by one, then link the project, the
assembly code as below:
double dMinVal = 0.01;
004c83E3 fld qword ptr [__real@3f847ae147ae147b
(679AF8h)]
004c83E9 fstp qword ptr [ebp-58h]

double dMaxVal = 0.99;
004c83EC fld qword ptr [__real@3fefae147ae147
(679AF0h)]
004c83F2 fstp qword ptr [ebp-68h]

the first MMX instruction is different, fldz and fld. The compiler
behaved quite strangely, I have not changed any project options but
just use ctrl+f7 to compile the cpp file then link the file. Any one
who can explain this strange situation?
Thanks and regards.
Robbie

Oct 8 '07 #1
0 1002

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
6306
by: Allcomp | last post by:
Hello, I have seen something really strange in VB6 If I do a Int ( (5 * 1.2)) , I receive the value 5, but I should receive 6? Is this a bug or something really "normal". I can see that if I...
35
4499
by: wired | last post by:
Hi, I've just taught myself C++, so I haven't learnt much about style or the like from any single source, and I'm quite styleless as a result. But at the same time, I really want nice code and I...
7
1695
by: Anon Email | last post by:
Hi people, I'm playing around with Bartosz Milewski's code at the moment, and I got the following strange results upon execution of the code included further below. Please be aware that I...
28
10243
by: Yacine | last post by:
Does anyone know why void main(){ double x; double *y; (int) y = x; } compiles well, and why
31
6575
by: Bjørn Augestad | last post by:
Below is a program which converts a double to an integer in two different ways, giving me two different values for the int. The basic expression is 1.0 / (1.0 * 365.0) which should be 365, but one...
4
1570
by: Valeriu Catina | last post by:
Hi, g++ gives the next error messages test.cpp: In function 'int main()': test.cpp:53: error: invalid conversion from 'int' to 'SmallVectorNoInit (*)()' test.cpp:53: error: initializing...
25
1853
by: Digital Puer | last post by:
I'm getting a very weird bit corruption in a double. I am on an Intel Red Hat Linux box. uname -a returns: Linux foo.com 2.6.9-34.0.2.ELsmp #1 SMP Fri Jun 30 10:33:58 EDT 2006 i686 i686 i386...
23
2230
by: mike3 | last post by:
Hi. I seem to have made some progress on finding that bug in my program. I deactivated everything in the bignum package that was used except for the returning of BigFloat objects. I even...
4
1590
by: TonyJ | last post by:
Hello! Assume I have the two classes Test1 and Test2. They are very similar. Test1 initialize the instance variable in the C-tor but Test2 initialize the instance variable without using the...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.