Objective
Implement a function that returns the absolute value of an int as a long, widening the value before it ever negates it.
Steps
$ abs_safe(42)
42
$ abs_safe(-1024)
1024
$ abs_safe(0)
0
$ abs_safe(INT_MAX)
2147483647
$ abs_safe(INT_MIN)
2147483648
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Objective
Implement a function that returns the absolute value of an int as a long, widening the value before it ever negates it.
Steps
$ abs_safe(42)
42
$ abs_safe(-1024)
1024
$ abs_safe(0)
0
$ abs_safe(INT_MAX)
2147483647
$ abs_safe(INT_MIN)
2147483648
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Tests
Run the tests to grade your code