Answers for "runtime error: signed integer overflow: 964632435 * 10 cannot be represented in type 'int'"

0

runtime error: signed integer overflow: 964632435 * 10 cannot be represented in type 'int'

while (x != 0) {
        int pop = x % 10;
        x /= 10;
        if (rev > INT_MAX/10 || (rev == INT_MAX / 10 && pop > 7)) return 0;
        if (rev < INT_MIN/10 || (rev == INT_MIN / 10 && pop < -8)) return 0;
        rev = rev * 10 + pop;
    }
Posted by: Guest on July-16-2020

Code answers related to "runtime error: signed integer overflow: 964632435 * 10 cannot be represented in type 'int'"

Browse Popular Code Answers by Language