Ошибка про несоответствие типа передаваемого параметра: int cannot be converted to BigInteger

Задача о зернах на шахматном поле рекурсией. Код:

public class Main {
    public static void main(String[] args) {
        go(1, 1);
    }

    static void go(int i, BigInteger count) {
        count *= 2;
        if (i >= 64) return;
        go(i + 1, count);
    }
}

Компилятор жалуется на несоответствие типа передаваемого параметра:

int cannot be converted to BigInteger  
        go(1, 1);


bad operand types for binary operator '*'
        count *= 2;

в чем дело?


Ответы (1 шт):

Автор решения: Eugene_Venev
count = count.multiply(BigInteger.valueOf(2));
→ Ссылка