[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-dev
Subject: [jira] [Commented] (NUMBERS-90) DoublePrecisionContext
From: "Gilles (JIRA)" <jira () apache ! org>
Date: 2019-01-31 23:53:00
Message-ID: JIRA.13206301.1545661193000.216390.1548978780110 () Atlassian ! JIRA
[Download RAW message or body]
[ https://issues.apache.org/jira/browse/NUMBERS-90?page=com.atlassian.jira.plugin. \
system.issuetabpanels:comment-tabpanel&focusedCommentId=16757813#comment-16757813 ]
Gilles commented on NUMBERS-90:
-------------------------------
I'll try to figure out a working example of what I attempted (but failed) to \
convey... Perhaps there is nothing to convey ;-) but I've to convince myself.
> DoublePrecisionContext
> ----------------------
>
> Key: NUMBERS-90
> URL: https://issues.apache.org/jira/browse/NUMBERS-90
> Project: Commons Numbers
> Issue Type: New Feature
> Reporter: Matt Juntunen
> Priority: Blocker
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> We should add a new class to commons-numbers-core that encapsulates configurable \
> strategies for comparing doubles. This is required for GEOMETRY-11. Here is what \
> I'm picturing: {code:java}
> // abstract class for the general concept of comparisons
> public abstract class DoublePrecisionContext implements Comparator<Double> {
> public abstract boolean equals(double a, double b);
> public int compare(double a, double b) { /* ... */ }
> public int compare(Double a, Double b) { /* ... */ }
> }
> // ...
> // concrete class implementing a specific strategy
> public class EpsilonUlpDoublePrecisionContext extends DoublePrecisionContext {
> public EpsilonUlpDoublePrecisionContext(double eps, double maxUlps) { /* ... */ }
> @Override
> public boolean equals(double a, double b) { /* ... */ }
> } {code}
> Pull request: https://github.com/apache/commons-numbers/pull/28
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic