这是我的代码:
static int compoundBalance(double db, double dbTwo, double dbThree) {
if(dbThree == 0) return db;
return (1 + dbTwo)*compoundBalance(db, dbTwo, dbThree-1);
}
我得到了这两个错误。我不知道该怎么做。有什么指导吗?谢谢你。
Factorial.java:60: error: possible loss of precision
if(dbThree == 0) return db;
^
required: int
found: double
Factorial.java:61: error: possible loss of precision
return (1 + dbTwo)*compoundBalance(db, dbTwo, dbThree-1);
^
required: int
found: double
2 errors