Is the result of a boolean operation guaranteed to be 1 or 0?
I'm programming a microcontroller and need to set a pin to 1 or 0, and was wondering if I can shorten the code from this:
isRunning = isStarted && !isSleeping;
_PBH0 = isRunning ? 1 : 0;
to this:
isRunning = isStarted && !isSleeping;
_PBH0 = isRunning;