[
https://issues.apache.org/jira/browse/GEOMETRY-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16761856#comment-16761856
]
Matt Juntunen commented on GEOMETRY-41:
---------------------------------------
I originally had it set to {{equals}} but that bit me in the rear since I ended
up writing buggy code like
{code:java}
if (precision.equals(valueA)) {
// do something
}
{code}
when what I actually wanted was
{code:java}
if (precision.equals(valueA, valueB)) {
// do something
}
{code}
The former compiles fine but it tests equality against the precision object
itself instead of between two values, which is what I wanted. So, I ended up
using a different name to help prevent this.
> Vector Precision Equals
> -----------------------
>
> Key: GEOMETRY-41
> URL: https://issues.apache.org/jira/browse/GEOMETRY-41
> Project: Apache Commons Geometry
> Issue Type: New Feature
> Reporter: Matt Juntunen
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The {{Vector?D}} classes should expose {{equals}} method overloads that allow
> a precision object from GEOMETRY-11 to be passed in to determine equality. I
> propose adding the following two methods:
> 1. {{boolean equals(Vector?D vec, DoublePrecisionContext precision)}}
> 2. {{boolean isZero(DoublePrecisionContext precision)}}
>
> Pull request: https://github.com/apache/commons-geometry/pull/24
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)