public double calc(int v1) {
return v1 / 2 + 1.5;
}
public double cald (double v) {
return v / 2 + 1.5;
}
Do the functions return the same result?
I would argue that they don’t return the same result, as the second function would include the decimal point, where as the second function would round the number up.
Is that correct?
when you divide
abybi.ea/bif both
a&bareintthen result will beintelse any or both
a&baredoublethen result will bedoubleEdit:
Also see my answer to this Question Simple Divide Problem