They already mention the issue of using substraction for comparison; here's another different accidentally intransitive comparison function:
int cmp(const float *a, const float *b) {
if (*a < *b) {
return 1;
} else if (*a == *b) {
return 0;
} else {
return -1;
}
}