You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Baljit Singh (JIRA)" <ji...@apache.org> on 2019/04/09 22:30:00 UTC

[jira] [Updated] (MATH-1478) Overflow in Vector norm and distance

     [ https://issues.apache.org/jira/browse/MATH-1478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Baljit Singh updated MATH-1478:
-------------------------------
    Affects Version/s: 3.6.1

> Overflow in Vector norm and distance
> ------------------------------------
>
>                 Key: MATH-1478
>                 URL: https://issues.apache.org/jira/browse/MATH-1478
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.6.1
>            Reporter: Baljit Singh
>            Priority: Minor
>
> 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)