bal_gennady

Math.round() Method

Dec 19th, 2016
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. public class Test {
  2.  
  3.    public static void main(String args[]) {
  4.       double d = 100.675;
  5.       double e = 100.500;
  6.       float f = 100;
  7.       float g = 90f;
  8.  
  9.       System.out.println(Math.round(d));
  10.       System.out.println(Math.round(e));
  11.       System.out.println(Math.round(f));
  12.       System.out.println(Math.round(g));
  13.    }
  14. }
Add Comment
Please, Sign In to add comment