I have such a method
public double count(double a, double b) {
return a + b;
}
for arguments: "111111111111111111111111111111111111111111 + 1"
Expected:
111111111111111111111111111111111111111112
Real output:
1.1111111111111112E41
how to change it?
public BigDecimal count(double a, double b) {
BigDecimal x= BigDecimal.valueOf(a);
BigDecimal y= BigDecimal.valueOf(b);
return x.add(y);
}
and for this Real output:111111111111111120000000000000000000000001.0 wtf?