This one got me curious.

I believe you are missing a couple of casts there. But regardless, I think it's an handy function that checks for =, <, and > between the arguments with just one return statement.