Listing 5: Tie-breaking comparison
int flt_abs_compare(const void * a, const void * b) { float va = *(float *)a; float vb = *(float *)b; float fa = fabs(va); float fb = fabs(vb); if (fa < fb) return -1; else if (fa > fb) return 1; else if (va < vb) return -1; else if (va > vb) return 1; else return 0; } /* End of File */