I want to divide two double number and then round up the result to integer
What is the easiest way ?
JavaJavaScript
Last Comment
CEHJ
8/22/2022 - Mon
BlueYonder
double a1=157;
double a2=32;
int total = (int) Math.ceil(a1/a2)
CEHJ
Math.ceil is not the same as rounding ...
Rainer Jeschor
Hi,
which programming language?
You added Java and JavaScript topics - but they are totally different languages with different data types and functions.
Thanks.
Rainer
double a2=32;
int total = (int) Math.ceil(a1/a2)