donavan@zimbu:~ >cat abc.c #include #include #include main() { printf("Before FPU stuff: %d\n", (int)(log(8.0)/log(2.0))); /* This puts the X86 FPU in 64-bit precision mode. The default # * under Linux is to use 80-bit mode, which produces subtle # * differences from FreeBSD and other systems, eg, # * (int)(1000*atof("0.3")) is 300 in 64-bit mode, 299 in 80-bit # * mode. # */ fpu_control_t cw; _FPU_GETCW(cw); cw &= ~_FPU_EXTENDED; cw |= _FPU_DOUBLE; _FPU_SETCW(cw); printf("After FPU stuff: %d\n", (int)(log(8.0)/log(2.0))); } donavan@zimbu:~ >gcc -lm abc.c donavan@zimbu:~ >./a.out Before FPU stuff: 3 After FPU stuff: 3 donavan@zimbu:~ >