commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <flame...@gmail.com>
Subject Re: LANG - useful to have float/double equals method?
Date Wed, 12 Jan 2011 16:28:52 GMT
-1 on enhancements in LANG 2.x; by which I mean that I personally am
not interested in spending effort on 2.x being anything other than a
critical bugfix legacy version.

Hen

On Wed, Jan 12, 2011 at 8:21 AM, sebb <sebbaz@gmail.com> wrote:
> On 12 January 2011 15:31, Ted Dunning <ted.dunning@gmail.com> wrote:
>> Why aren't the comparison methods in java (since 1.4) good enough?
>
> 1) LANG 2.x targets 1.3
>
> 2) compare does not take into account that floats/doubles are inexact,
> so some tolerance is needed.
>
> See http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
> for useful explanation.
>
> Furthermore, both compare() and equals() treat +0 and -0 as being unequal.
>
>> http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Double.html#compare(double,
>> double)
>>
>> http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Float.html#compare(float,
>> float)
>>
>> On Wed, Jan 12, 2011 at 3:15 AM, sebb <sebbaz@gmail.com> wrote:
>>
>>> Would it be useful to add an equals method for float/double?
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message