ipo
03-18-2001, 10:29 AM
I ran into something strange with Borland's C++ Builder. Try this
[CODE]
void main(void) {
float x;
double y;
x = 2,585,463,658.2;
y = 2,585,463,658.2;
}
Trace the program and check the values of x and y. The value of y should be ok. However the value of x will be 2,585,463,552.
Or am I doing something wrong? I checked this on C++ Builder 3 and 4 but have not tried the other compilers.
ipo
[CODE]
void main(void) {
float x;
double y;
x = 2,585,463,658.2;
y = 2,585,463,658.2;
}
Trace the program and check the values of x and y. The value of y should be ok. However the value of x will be 2,585,463,552.
Or am I doing something wrong? I checked this on C++ Builder 3 and 4 but have not tried the other compilers.
ipo