3 ms·
A related issue is that software floating point must be used in the Linux kernel. Because floating point is rarely needed in kernel programming, FPU registers a
by gnode 7y ago
A related issue is that software floating point must be used in the Linux kernel. Because floating point is rarely needed in kernel programming, FPU registers are not swapped when execution switches between kernel and user code. Instead, they're only switched when context switching between different processes using the FPU, and initially processes run with floating point instructions disabled.
> Basically it is almost always better to use integers when you can
I'd say: understand the limitations of FP, but it's almost always better to use them unless you have some particular precision or performance requirement. Then again, my experience of FP is mostly in graphics, where IEEE 754 single precision is good enough for almost anything you'd want, and hardware FP is commonplace.