[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sort error when NaN and NA are both present
From: |
John W. Eaton |
Subject: |
Re: sort error when NaN and NA are both present |
Date: |
Tue, 17 Jan 2012 15:56:10 -0500 |
On 17-Jan-2012, Jordi Gutiérrez Hermoso wrote:
| On 17 January 2012 12:22, Mark Messer <address@hidden> wrote:
| > I am not sure if this is worth a bug report or not. These ought to have the
| > same answer.
| >
| > I am using 32 bit Windows Vista, and Octave 3.4.3.
| >
| >
| > octave:713> sort([NaN,NA,inf,1,-inf])
| > ans =
| >
| > -Inf 1 Inf NaN NA
| >
| > octave:714> sort([NA,NaN,inf,1,-inf])
| >
| > ans =
| >
| > -Inf 1 Inf NA NaN
|
| Every comparison with NaN is false. NA is just another name for NaN in
| Octave. So NaN are unsorted. This is part of the IEEE 754 standard.
NA is a particular NaN value, so it would be possible to sort NA
vs. other NaN values. But I'm not sure it is worth the effort.
jwe