Re: how long is double
From: Cy Edmunds (cedmunds_at_spamless.rochester.rr.com)
Date: 01/04/04
- Next message: Cy Edmunds: "Re: Could anyone explain the code for me?"
- Previous message: Derek Baker: "Re: [OT] ACCU website"
- In reply to: f: "how long is double"
- Next in thread: Andrew Koenig: "Re: how long is double"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 04 Jan 2004 02:43:49 GMT
"f" <ffunus@yahoo.com> wrote in message
news:8f4ce98a.0401031338.4208ac8@posting.google.com...
> I have this
>
> double sum, a, b, c;
> sum = a + b + c;
You used a, b, and c without initializing them. Was this your intent?
> 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,
Looks the same to me. And where is that trailing comma coming from?
>
> 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.
Perhaps you can coax The Great Carsoni out of retirement. Or post some code.
>
> Why?
>
> Thanks,
>
> ff
>
> [ See http://www.gotw.ca/resources/clcm.htm for info about ]
> [ comp.lang.c++.moderated. First time posters: Do this! ]
Your massive crossposting is very bad usenet manners.
-- Cy http://home.rochester.rr.com/cyhome/
- Next message: Cy Edmunds: "Re: Could anyone explain the code for me?"
- Previous message: Derek Baker: "Re: [OT] ACCU website"
- In reply to: f: "how long is double"
- Next in thread: Andrew Koenig: "Re: how long is double"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|