|
-
January 12th, 2010, 04:57 PM
#1
Yet another stupid question from The Old Guy
Hi,
back again with another of my inane questions.
I am using VS 2008 (is that C# 3.5?) and discovered a result I can't explain in what I thought would be a simple statement.....
in a static, constant-definition class, I have the statement
"public static double test = (2e31 - 1.0);
It seems to compile as 2e31 .... it appears that the "-1.0" term was dropped.
I verified this by setting an int to that value, then asking the debugger to print the result in hex. The debugger reports that the int's value is indeed 0x80 00 00 00 rather than the value 0x7F FF FF FF I expected.
It's as if the compiler is ignoring the "- 1.0".
Does that seem right to you ? does it do it on your machine ?
thanks for helping an old man struggling with age-related issues come to grips once again with computer fundamentals.
bill
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|