Created
September 6, 2019 10:13
-
-
Save stfwn/62e52cce89d6b226db92dc90abc52ee7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int isAsciiDigit(int x) { | |
int overflower = (1 << 31) ^ (~0x39); | |
int overflowed = (x + overflower) >> 31; | |
if (overflowed) { | |
printf("Overflowed, so not an AsciiDigit.\n"); | |
} | |
return !overflowed & !((x >> 4) ^ 3); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment