[ 
https://issues.apache.org/jira/browse/GEOMETRY-50?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816375#comment-16816375
 ] 

Gilles commented on GEOMETRY-50:
--------------------------------

bq. Creating double[] unnecessarily isn't performant.

Perhaps, but given the relative complexity of 
[{{SafeNorm}}|https://gitbox.apache.org/repos/asf?p=commons-numbers.git;a=blob;f=commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/SafeNorm.java],
 the assertion should be backed with 
[benchmarks|https://openjdk.java.net/projects/code-tools/jmh/].

> Overflow in Vector norm and distance
> ------------------------------------
>
>                 Key: GEOMETRY-50
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-50
>             Project: Apache Commons Geometry
>          Issue Type: Bug
>            Reporter: Baljit Singh
>            Priority: Major
>
> In Euclidean Vector classes (Vector2D, Vector3D), norm() and distance() rely 
> on Math.sqrt(), which can overflow if the components of the vectors are 
> large. Instead, they should rely on SafeNorm.



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

Reply via email to