How to perform the ceiling operation on a decimal number in Java

1 Answer

0 votes
class Program {
    public static void main(String[] args) {
        double num = 723465.4084;
        System.out.println(Math.ceil(num));
        
        num = 723465.5084;
        System.out.println(Math.ceil(num));
    }
}
 
 
 
/*
run:
 
723466.0
723466.0
 
*/

 



answered Mar 6, 2024 by avibootz

Related questions

2 answers 186 views
2 answers 216 views
3 answers 231 views
2 answers 211 views
2 answers 167 views
...