c - Absolute value of INT_MIN - Stack Overflow
Casting into the next available greater integer type should do it. but you have to use the correspondant abs-variant (in this case llabs(...)) printf("llabs(INT_MIN): %lld\n", llabs((long long int)INT_MIN)); edit: you can check what's the next greater...