commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Juntunen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEOMETRY-51) EpsilonDoublePrecisionContext allows negative & NaN epsilon
Date Fri, 12 Apr 2019 01:48:00 GMT

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

Matt Juntunen commented on GEOMETRY-51:
---------------------------------------

We should probably just check for this on construction and throw an {{IllegalArgumentException}}.
Feel free to submit a PR on Github.

> EpsilonDoublePrecisionContext allows negative & NaN epsilon
> -----------------------------------------------------------
>
>                 Key: GEOMETRY-51
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-51
>             Project: Apache Commons Geometry
>          Issue Type: Bug
>            Reporter: Baljit Singh
>            Priority: Major
>
> EpsilonDoublePrecisionContext does not validate the epsilon to be positive (0 or greater).
The comparison is based on Precision.compareTo(double, double, double), which itself calls
Precision.equals(double, double, double), which then compares using Math.abs(y - x) <=
eps. If epsilon is negative or NaN, the comparison is invalid.



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

Mime
View raw message