3 ms·
You mean dynamically setting rounding modes depending on what operation you're doing? How do you do this performantly while staring down the barrel of context s
by nwallin 7y ago
You mean dynamically setting rounding modes depending on what operation you're doing? How do you do this performantly while staring down the barrel of context switching, third party dependencies, programmers who are at least as dumb as I am...?
My general rule of thumb is that if your code might fail if someone swaps out IEEE 754 floating point semantics for some other representation that's at most as goofy as IEEE 754, your code is probably wrong.
- garmaine 7y agoContext switching preserves fpu modes. You set these inside inner loops where you aren’t calling out to third party dependencies. Good libraries make this easy to work with. This is exactly how IEEE 754 was designed to work, and is what all the major numerical libraries do.