[
https://issues.apache.org/jira/browse/NUMBERS-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17329237#comment-17329237
]
Gilles Sadowski edited comment on NUMBERS-77 at 4/22/21, 4:26 PM:
------------------------------------------------------------------
{quote}
{code}
default double signum(double a) {
return (a == 0.0 || compare(a, 0.0) == 0 || Double.isNaN(a)) ? a :
Math.copySign(1.0, a);
}
{code}
{quote}
I think that there is a problem when {{0 < |a| < eps}}.
The following
{code}
return a == 0d ||
Double.isNaN(a) ?
a :
eqZero(a) ?
Math.copySign(0d, a) :
Math.copySign(1d, a);
{code}
seems to behave as intended.
was (Author: erans):
{quote}
{code}
default double signum(double a) {
return (a == 0.0 || compare(a, 0.0) == 0 || Double.isNaN(a)) ? a :
Math.copySign(1.0, a);
}
{code}
{quote}
I think that there is a problem when {{0 < |a| < eps}}.
> Move utilities from "Commons Geometry"
> --------------------------------------
>
> Key: NUMBERS-77
> URL: https://issues.apache.org/jira/browse/NUMBERS-77
> Project: Commons Numbers
> Issue Type: Task
> Reporter: Gilles Sadowski
> Priority: Major
> Fix For: 1.1
>
> Attachments: NUMBERS-77.diff
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> "Commons Geometry" defines utilities that would be a better fit in this
> component.
> Duplication of general-purpose codes should be avoided, in order to benefit
> from consolidated usage (bug reporting, performance enhancements, ...).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)