From octave-maintainers-request at bevo dot che dot wisc dot edu Tue Jan 6 13:38:17 2004 Subject: Re: benchmarks - sort From: Schloegl Alois To: "John W. Eaton" Cc: octave-maintainers at bevo dot che dot wisc dot edu Date: Tue, 6 Jan 2004 20:38:00 +0100 Zitat von "John W. Eaton" : > On 6-Jan-2004, Schloegl Alois wrote: > > | One reason, for the bad performance of the sort algorithm might be the > exception > | handling of NaNs. See also > | http://www.octave.org/octave-lists/archive/bug-octave.2001/msg00047.html > | > | Sorting on the binary level might be helpful, because the bit patterns of > the > | IEEE754 numbers provide the correct sorting order. This is > | -inf < -1 < 0 < 1 < inf < NaN > > Can you explain precisely what you mean by sorting on the binary > level? > > jwe > Instead of floating point comparison, one could use integer comparision. Because the exponent is in the Most Significant Bytes, a comparison based This would require casting floating point numbers into integers (signed long long should do), and casting does not take any effort in C. Alois