Mark Dickinson <dicki...@gmail.com> added the comment:

Special cases aside, I think this is a YAGNI. The "obvious" formulas `(a + 
b)/2)` and `0.5 * (a + b)` _do_ do exactly the right thing (including giving a 
perfectly correctly-rounded answer with round-ties-to-even on a typical IEEE 
754-using machine) provided that subnormals and values very close to the upper 
limit are avoided. If you're doing floating-point arithmetic with values of 
size > 1e300, you've probably already got significant issues.

I could see specialist uses for this, e.g., in a general purpose bisection 
algorithm, but I'm not convinced it's worth adding something to the math 
library just for that.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36493>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to