java math ceil example

Solutions on MaxInterview for java math ceil example by the best coders in the world

showing results for - "java math ceil example"
Jannik
13 May 2020
1Math.ceil(value);
Gianluca
23 Jan 2021
1The ceiling of a floating point number is the smallest integer that is >= to the number.
Linus
23 Apr 2017
1import java.lang.*;
2
3public class Math {
4
5   public static void main(String[] args) {
6
7      // get two double numbers
8      double x = 125.9;
9      double y = 0.4873;
10   
11      // call ceal for these these numbers
12      System.out.println("Math.ceil(" + x + ")=" + Math.ceil(x));
13      System.out.println("Math.ceil(" + y + ")=" + Math.ceil(y));
14      System.out.println("Math.ceil(-0.65)=" + Math.ceil(-0.65));
15   }
16}