Baljit Singh created MATH-1478:
----------------------------------

             Summary: Overflow in Vector norm and distance
                 Key: MATH-1478
                 URL: https://issues.apache.org/jira/browse/MATH-1478
             Project: Commons Math
          Issue Type: Improvement
            Reporter: Baljit Singh


In Euclidean Vector classes (Vector2D, Vector3D), getNorm() and distance() rely 
on FastMath.sqrt(), which can overflow if the components of the vectors are 
large. Instead, they should rely on FastMath.hypot(double, double, double), 
which is equivalent to FastMath.hypot(double, double), but with 3 (or N) 
arguments.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to