|
From: | Mark Messer |
Subject: | Re: sort error when NaN and NA are both present |
Date: | Tue, 17 Jan 2012 18:17:25 -0800 |
octave:772> num2hex(NaN)ans = 7ff8000000000000octave:773> num2hex(NA)ans = 7ff840f440000000octave:774> isnan(NA)ans = 1octave:775> isequalwithequalnans(NaN,NA)ans = 1octave:776> NaN==NaNans = 0octave:777> NaN!=NaNans = 1octave:778> NaN==NAans = 0octave:779> NaN!=NAans = 1octave:780> NA==NA
ans = 0
octave:781> NA!=NA
ans = 1
NA is a particular NaN value, so it would be possible to sort NAOn 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.vs. other NaN values. But I'm not sure it is worth the effort.jwe
[Prev in Thread] | Current Thread | [Next in Thread] |