how long is double
From: f (ffunus_at_yahoo.com)
Date: 01/04/04
- Previous message: Jack Klein: "Re: Number of files in a directory..."
- Next in thread: Cy Edmunds: "Re: how long is double"
- Reply: Cy Edmunds: "Re: how long is double"
- Reply: Andrew Koenig: "Re: how long is double"
- Reply: Jack Klein: "Re: how long is double"
- Reply: Thomas Mang: "Re: how long is double"
- Reply: Francis Glassborow: "Re: how long is double"
- Reply: Ron Natalie: "Re: how long is double"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 3 Jan 2004 21:26:11 -0500
I have this
double sum, a, b, c;
sum = a + b + c;
printf("%.20f = %.20f, %.20f, %.20f", sum, a, b, c);
I found that the debug version and release version of the same code
give me different result. I am using VC++ 6.0.
In debug version, the print out is:
-12.25938471938358500000 = -11.43596388399630500000,
-0.07591666113607631300, -0.74750417425120252000,
In the release version, the print out is:
-12.25938471938358300000 = -11.43596388399630500000,
-0.07591666113607631300, -0.74750417425120252000,
The above sum = a + b + c is just a part of my computation. I found
that my whole computation crushed in the debug version because some
number became zero and another number divide this number. But this did
not happened in the release version.
Why?
Thanks,
ff
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
- Previous message: Jack Klein: "Re: Number of files in a directory..."
- Next in thread: Cy Edmunds: "Re: how long is double"
- Reply: Cy Edmunds: "Re: how long is double"
- Reply: Andrew Koenig: "Re: how long is double"
- Reply: Jack Klein: "Re: how long is double"
- Reply: Thomas Mang: "Re: how long is double"
- Reply: Francis Glassborow: "Re: how long is double"
- Reply: Ron Natalie: "Re: how long is double"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|