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

Alex Herbert commented on MATH-1698:
------------------------------------

Signed zeros for real numbers are an important feature of the IEEE 754 double 
representation allowing underflow from negative or positive numbers to be 
represented as distinct cases. Removing the sign has the edge case where 
correlations will change if the numbers are from genuine underflow results. So 
the PR to remove the signed zeros is a behavioural change.

It seems the class just need to be consistent with itself. If you sort using 
compare then you cannot test equality using ==. This class uses equals so it is 
consistent. It may not be what the user desires. Then it could be documented as 
treating signed zeros as distinct.

Note: The class uses a List<Pair<Double, Double>>. This is private so should be 
refactored to List<double[]> to avoid boxing.

> KendallsCorrelation
> -------------------
>
>                 Key: MATH-1698
>                 URL: https://issues.apache.org/jira/browse/MATH-1698
>             Project: Commons Math
>          Issue Type: Sub-task
>          Components: legacy
>    Affects Versions: 4.0-beta1
>            Reporter: Gilles Sadowski
>            Priority: Major
>              Labels: bug, refactoring
>             Fix For: 4.0-beta2
>
>
> Report for discussing [GH PR 
> #357|https://github.com/apache/commons-math/pull/357].



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to