Cytat(freemp3 @ 6.08.2013, 11:27:11 )

Po drugie, odejmowanie także nie ma prawa zadziałać. Funkcja ma zwrócić 1 jeśli a jest większe od b, -1 jeśli b jest większe od a lub 0 jeśli a i b są równe.
Kolego, gwoli ścisłości, nie masz racji. Wartości zwracane to nie "-1", "0", "1", tylko "mniej niż zero", "0", "więcej niż zero". Więc równie dobrze zamiast -1 możesz zwracać -2, -999 czy -312. Ale -0.9 już nie.
Cytat
The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Cytat
Caution Returning non-integer values from the comparison function, such as float, will result in an internal cast to integer of the callback's return value. So values such as 0.99 and 0.1 will both be cast to an integer value of 0, which will compare such values as equal.