I occasionally will come across an integer type (e.g. POSIX signed integer type off_t) where it would be helpful to have a macro for its minimum and maximum val
off_t
For sign-magnitude representations, it's fairly easy (for types at least as wide as int, anyway):
int
#define SM_TYPE_MAX(type) (~(type)-1 + 1) #define SM_TYPE_MIN(type) (-TYPE_MAX(type))
Unfortunately, sign-magnitude representations are rather thin on the ground ;)