You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2013-01-11.14:57:43.131>created_at=<Date2013-01-11.14:13:56.837>labels= ['ctypes', 'type-bug', 'invalid']
title="qsort doesn't work for double arrays"updated_at=<Date2013-01-11.14:57:43.127>user='https://bugs.python.org/stephanepoirier'
qsort doesn't sort arrays that are defined with double elements.
You can find attached a script that shows this function working well for int (as described in the ctypes documentation). If int array is replaced by double array qsort doesn't sort any more.
Even worse, with python 2.6, the difference between a[0] and b[0] may be nan.
The script can be launch by
python.exe testQSort33.py
Closing as invalid: the issue is not in Python but with the CMPFUNC line. Your py_cmp_func should return an integer rather than a float to be compatible with libc.qsort.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: