Created
February 27, 2012 21:59
-
-
Save benstiglitz/1927376 to your computer and use it in GitHub Desktop.
silly
This file contains 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
#define is_signed(T) ({ intmax_t __s = -1; T __t = (T)__s; __t < 0; }) | |
#define maxofint(T) (is_signed(T) == 0 ? \ | |
((uintmax_t)1 << (sizeof(T) * 8)) - 1 : \ | |
((uintmax_t)1 << (sizeof(T) * 8 - 1))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment