Implements the ascending flag for basic type comparators.