Am 04.12.2014 um 21:27 schrieb Allin Cottrell:
On Thu, 4 Dec 2014, Sven Schreiber wrote:
>>
>> I tried a little test program on Windows 8. It turns out that the C
>> library does return 0 for all comparisons involving a NaN (>, < and
>> ==), as it should. Nonetheless, qsort() with our original simple
>> callback sorts NaN (invoked via 0.0/0.0) to the start of an array of
>> doubles. I don't know how that happens!
>
> sorry for being clueless, but what is qsort() -- gretl's internal call
> to a quicksort algorithm perhaps?
qsort is the standard C library quicksort function (defined in
stdlib.h). Gretl calls it for sorting -- we haven't felt a need for
our own quicksort implementation. But to use qsort you need to supply
your own comparison function for the objects you're sorting (what I'm
calling the "callback").
Ok, anything I could do to investigate this issue further?
thanks,
sven