How to get the smallest integer that is greater than or equal to a number (ceil) in Groovy

1 Answer

0 votes
double d = -3.7
System.out.println(Math.ceil(d))

d = 3.9
System.out.println(Math.ceil(d))

d = 3.4
System.out.println(Math.ceil(d))



/*
run:

-3.0
4.0
4.0

*/

 



answered Oct 3, 2020 by avibootz
edited Oct 4, 2020 by avibootz
...