The functions isless, and friends (see https://en.cppreference.com/w/c/numeric/math/isless) are C99 standardized and should be equivalent to the normal math operators but not set floating point exceptions. I expect that using these macros would remove almost all of the places where we currently set npy_clear_floatstatus_barrier().
That would both slightly speed things up (at least if errors did occur npy_clear_floatstatus_barrier is pretty slow), and just be slightly more correct not to worry set the flags in the first place.
In the long-run, I am also thinking of chaining (e.g. by numexpr), where a call to npy_clear_floatstatus_barrier could silence floating point warnings, if the ufuncs are chained in lowlevel C.
EDIT: https://www.gnu.org/software/libc/manual/html_node/FP-Comparison-Functions.html is probably a nice reference
The functions
isless, and friends (see https://en.cppreference.com/w/c/numeric/math/isless) are C99 standardized and should be equivalent to the normal math operators but not set floating point exceptions. I expect that using these macros would remove almost all of the places where we currently setnpy_clear_floatstatus_barrier().That would both slightly speed things up (at least if errors did occur
npy_clear_floatstatus_barrieris pretty slow), and just be slightly more correct not to worry set the flags in the first place.In the long-run, I am also thinking of chaining (e.g. by numexpr), where a call to
npy_clear_floatstatus_barriercould silence floating point warnings, if the ufuncs are chained in lowlevel C.EDIT: https://www.gnu.org/software/libc/manual/html_node/FP-Comparison-Functions.html is probably a nice reference