On Mar 15, 2012, at 12:42 PM, alawatthe wrote:
> Just yesterday I released my JavaScript library for mathematical computations
> https://github.com/alawatthe/MathLib
> It supports more than two arguments in it's hypot function.
> So there is at least one library supporting variadic hypot functions :-)
Except that a variadic hypot function is non-trivial to implement (in a way
that people expect it to behave), the one implemented above is essentially just
sugar and can overflow even though the result is inside the range of a double.
Usually hypot is implemented something like |x| * sqrt(1 + (y / x)^2) (|x| >
|y|) instead, but such a formula for a variadic hypot is probably non-trivial.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss