|
-
May 10th, 2011, 03:58 PM
#1
Adding doubles together produces different results in Release vs. Debug mode.
Hi All,
I am running into a problem when adding together three doubles. The result I get when running in Debug mode does not match what I get in Release mode.
The three parts have the same value in both modes
dPart1 = 1237.8599999999999
dPart2 = 2351.9300000000003
dPart3 = 5407.3799999999992
When I add the three parts together in Debug Mode I get
8997.1699999999983
When I add the three parts together in Release Mode I get
8997.1700000000001
The Release Mode value is incorrect and is causing the application to display a value that is one penny too much.
I'm not sure what is causing this to happen.
If anyone has any ideas please let me know.
Thanks so much.
Greg
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
|