cout.setf(ios_base::fixed, ios_base::floatfield);
double a=5.67;
double b = a*10000;
int c = a*10000;
int d = (double)(b);
printf("a: %lf b: %lf c: %d d: %d", a, b, c, d);
While it is true that Linux does not use floating point arithmetic in the kernel, I think
the larger reason for this is to avoid the need to save/restore state of the FPU
every time a context switch occurs.