my code:
static int klassenBreite(int histMin, int histMax, int klassen) {
int abstand =(int) ((histMax- histMin)/klassen +0.5);
return abstand;
}
if I run
klassenBreite(100,200,8);
I should get 13, but my program calculates it to be 12. I really don't know what went wrong, if I do it by hand it gives 13. I am not sure if I'm rounding it correctly.