B
Barry
The following code compiled using MSVC++6.0 -
double di=0.0;
for(;di<=512.0
{
string.Format("%li",int(di));
pDC-> TextOut( left +int(di), 100,string);
di += 51.2;
}
gives the following unexpected output -
0 51 102 153 204 256 307 358 409 460 511
Why 511 and not 512??
Replacing with -
string.Format("%lf",di);
gives 512.00000
so why is the casting of 512.0 {int(di)} giving 511??
Thanks,
Barry.
double di=0.0;
for(;di<=512.0
{
string.Format("%li",int(di));
pDC-> TextOut( left +int(di), 100,string);
di += 51.2;
}
gives the following unexpected output -
0 51 102 153 204 256 307 358 409 460 511
Why 511 and not 512??
Replacing with -
string.Format("%lf",di);
gives 512.00000
so why is the casting of 512.0 {int(di)} giving 511??
Thanks,
Barry.