Compare function in Inbuilt Sort

If bool is supposed to return only true(1) or false(0) value, how can compare function return a>b?

@anikapassi17_6ce74879d4a8438b thats another way to say if(a>b) return 1 else 0