User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







java:lang:math:round

Math.round

rounds a number

example of round in java

package roundanumber;
import java.lang.Math;
 
public class Roundanumber {
 
 
    public static void main(String[] args) {
        // TODO code application logic here
 
        double number, number2;
        number = 33.384422;
        number2 = 33.898823;
 
    System.out.println("number: " + Math.round(number));
    System.out.println("number2: " + Math.round(number2));
    }
}

output of Roundanumber

  number: 33
  number2: 34

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
java/lang/math/round.txt · Last modified: 2024/02/16 01:12 (external edit)

Impressum Datenschutz