[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Commented] (MATH-1368) equalsIncludingNaN not producing the expected result
From:       "Earle Nietzel (JIRA)" <jira () apache ! org>
Date:       2016-05-31 22:57:12
Message-ID: JIRA.12973470.1464371312000.343405.1464735432899 () Atlassian ! JIRA
[Download RAW message or body]


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

Earle Nietzel commented on MATH-1368:
-------------------------------------

Just to circle back, I tested this with commons-math3 3.6.1 and it performs \
appropriately. x=-1.0, y=4.0
Double.doubleToLongBits(x) = -4616189618054758400
Double.doubleToLongBits(y) = 4616189618054758400
x.equals(y) = false
Precision.equalsIncludingNaN(x, y) = false
Precision.equals(x, y) = false

> equalsIncludingNaN not producing the expected result
> ----------------------------------------------------
> 
> Key: MATH-1368
> URL: https://issues.apache.org/jira/browse/MATH-1368
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 2.2
> Reporter: Earle Nietzel
> 
> I wouldn't expect this result given these 2 values?
> x=-1.0, y=4.0
> x to long bits = -4616189618054758400
> y to long bits = 4616189618054758400
> x equals y = false
> MathUtils.equalsIncludingNaN(x, y) = true
> MathUtils.equals(x, y) = false
> It appears the lexicographic ordering logic is producing this, other numbers are \
> fine. Notice the value produced for -1.0 and 4.0 by Double.doubleToLongBits().



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic