numpy/numpy — pull request #3739 by arinkverma (2013-09-13 22:59:52+00:00)
Title: ENH: Speedup UFUNC_CHECK_STATUS by avoding heavy clear opition

UFUNC_CHECK_STATUS is just single macro which do both checking clearing the error flags. It clear error flags every time after checking. We should avoid clear operation if not needed, as it is a bit expensive and take significant amount of time.

The way numpy detect divide-by-zero, overflow, underflow, etc., is that before each ufunc loop it clear the FP error flags, and then after the ufunc loop we see if any have become set. And clear again. I have avoided clear if not needed to save time.