How did you enter the -2147483648
? If you just typed it directly into your program, that would be the unary -
applied to the literal, not a literal including the -
. Since 2147483648 doesn't fit in an int
, your literal gets the unsigned
type.
Either use INT_MIN
, or use the trick most libraries use to define it:
isPositive(-2147483647 - 1);