K
Kelly Mah
Sorry if I got the wrong group.
I seem to be running into a rounding issue on a Linux AS2.1 box using
gcc 2.95. This program always returns 419 on Linux, but on a Solaris
machine, I get the expected 420 output.
------------------------------------------------
#include <math.h>
#include <stdio.h>
int main()
{
double x = 0.0010;
double y = 0.420;
int result = 0;
result = (int)(y/x);
printf("y/x is %d\n",result);
return 0;
}
I seem to be running into a rounding issue on a Linux AS2.1 box using
gcc 2.95. This program always returns 419 on Linux, but on a Solaris
machine, I get the expected 420 output.
------------------------------------------------
#include <math.h>
#include <stdio.h>
int main()
{
double x = 0.0010;
double y = 0.420;
int result = 0;
result = (int)(y/x);
printf("y/x is %d\n",result);
return 0;
}