why is double negation useful in shiftOut for example?

Which is unnecessary, because in digitalWrite() it only tests if the value passed is equal to LOW (ie, 0)...

	if (val == LOW) {
		*out &= ~bit;
	} else {
		*out |= bit;
	}