
On Mon, 12 Oct 2020 at 07:23, Christopher Barker <pythonchb@gmail.com> wrote:
FWIW, if a change were to be made, I'd rather it be some kind of float error handling context: either a global setting, like numpy's, or a context manager. With, of course, the default behavior just like it's been forever.
You can have both a global setting and then a context manager for altering it, although it would need to be thread-safe. I would certainly make use of an option to have exceptions instead of nans. I did suggest something similar at some point and was pointed to fpectl: https://docs.python.org/2/library/fpectl.html I haven't looked in any detail but I suspect that making fpectl work on all platforms is not really viable: this should probably be handled within the interpreter rather than at the FPU level (although that could be used as an optimisation for some platforms). -- Oscar