Re: Problem with long double in MS VC++ v6.0 ?
From: Anthony Borla (ajborla_at_bigpond.com)
Date: 03/19/05
- Next message: Basil Fawlty: "Re: Simple Welding of two small C/C++ Programs, But How??"
- Previous message: Anthony Borla: "Re: Simple Welding of two small C/C++ Programs, But How??"
- In reply to: spiatek : "Problem with long double in MS VC++ v6.0 ?"
- Next in thread: Francis Glassborow: "Re: Problem with long double in MS VC++ v6.0 ?"
- Reply: Francis Glassborow: "Re: Problem with long double in MS VC++ v6.0 ?"
- Reply: James Dennett: "Re: Problem with long double in MS VC++ v6.0 ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 19 Mar 2005 19:02:31 GMT
"spiatek " <spiatek@neostrada.pl > wrote in message
news:d1hrfs$oi4$1@nemesis.news.tpi.pl...
> I wrote such programme:
>
> long double A,B,C;
>
> A=2e-1;
> C=1e-17;
> B=A+C;
>
> if(A==B)
> {
> A=1;
> }
> else
> {
> B=1;
> }
>
> Why does computer still sees, that A == B?
> What do to make programme to calculate correctly?
> Maybe alter something in options VC++ ?
>
Try the following code:
#include <stdio.h>
int main(void)
{
printf("sizeof double: %d\n", sizeof(double));
printf("sizeof long double: %d\n", sizeof(long double));
return 0;
}
If the sizes are the same then you have your answer :) !
Cheers,
Anthony Borla
- Next message: Basil Fawlty: "Re: Simple Welding of two small C/C++ Programs, But How??"
- Previous message: Anthony Borla: "Re: Simple Welding of two small C/C++ Programs, But How??"
- In reply to: spiatek : "Problem with long double in MS VC++ v6.0 ?"
- Next in thread: Francis Glassborow: "Re: Problem with long double in MS VC++ v6.0 ?"
- Reply: Francis Glassborow: "Re: Problem with long double in MS VC++ v6.0 ?"
- Reply: James Dennett: "Re: Problem with long double in MS VC++ v6.0 ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|