You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vxquery.apache.org by Eldon Carman <ec...@ucr.edu> on 2012/08/22 22:37:55 UTC

Comparisons classes for double and float NaN values

In the case where double or float hold a "NaN" value the result for
both less than and greater than is false. Currently the way of
determining greater than is the opposite of the less than and equal
result. For when NaN is one of the values this does not work. How
would you suggest we address this issue?

Re: Comparisons classes for double and float NaN values

Posted by Eldon Carman <ec...@ucr.edu>.
Yes, I went ahead add added these exceptions to the Abstract classes.

On Wed, Aug 22, 2012 at 11:29 PM, Till Westmann <ti...@westmann.org> wrote:
> Would it be possible to special-case this in the AbstractNegatingComparisonOperation?
> Otherwise it seems to be that we would need to special-case this in the subclasses of AbstractNegatingComparisonOperation by overriding the corresponding operate... methods.
>
> Does this make sense?
>
> Cheers,
> Till
>
> On Aug 22, 2012, at 1:37 PM, Eldon Carman wrote:
>
>> In the case where double or float hold a "NaN" value the result for
>> both less than and greater than is false. Currently the way of
>> determining greater than is the opposite of the less than and equal
>> result. For when NaN is one of the values this does not work. How
>> would you suggest we address this issue?
>

Re: Comparisons classes for double and float NaN values

Posted by Till Westmann <ti...@westmann.org>.
Would it be possible to special-case this in the AbstractNegatingComparisonOperation?
Otherwise it seems to be that we would need to special-case this in the subclasses of AbstractNegatingComparisonOperation by overriding the corresponding operate... methods.

Does this make sense?

Cheers,
Till

On Aug 22, 2012, at 1:37 PM, Eldon Carman wrote:

> In the case where double or float hold a "NaN" value the result for
> both less than and greater than is false. Currently the way of
> determining greater than is the opposite of the less than and equal
> result. For when NaN is one of the values this does not work. How
> would you suggest we address this issue?