__builtin_expect works with strict equality, so the double negation point here is to make sure that all right values ββare converted to 1 (and thus correspond to 1 in GSL_LIKELY ), and all false values ββcorrespond to 0 in GSL_UNLIKELY .
Double negation persists even if __builtin_expect not available to maintain uniformity (since the caller can store the return value for other purposes, except as a condition in if ).
source share