[issue1880] Generalize math.hypot function

Mark Dickinson report at bugs.python.org
Mon Jan 21 05:33:25 CET 2008


Mark Dickinson added the comment:

I'm not sure either that such a generalization would belong in math (which right now 
does little more than expose some basic functions from the C library) or that it 
should be called hypot.

It seems to me that this would belong with other vector-type math stuff, but there 
isn't any of that in core Python or the libraries at the moment.

On one hand, this falls foul of the 'not every one-liner should be a builtin' rule.  
On the other hand, it's not a one-liner if done properly:  compare the output of 
math.hypot(1e160, 1e160) with the output of your version.  Similarly for 
math.hypot(1e-160, 1e-160).

----------
nosy: +marketdickinson
priority:  -> low

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1880>
__________________________________


More information about the Python-bugs-list mailing list