4 ms·
It's also logically incoherent - division by zero can't occur, because if b=0 then abs(b) < sys.float_info.epsilon. Furthermore, the code is happy to return Na
by criemen 1y ago
It's also logically incoherent - division by zero can't occur, because if b=0 then abs(b) < sys.float_info.epsilon.
Furthermore, the code is happy to return NaN from the pre-checks, but replaces a NaN result from the division by None. That doesn't make any sense from an API design standpoint.