<reponame>RAstardzhiev/Java-Book-Exercises

package Chapter_4;

public class CP_4_1_Round {
    public static void main(String[] args) {
        
        System.out.println("(a) Math.sqrt(4) = " + Math.sqrt(4));
        System.out.println("(b) Math.sin(2 * Math.PI) = " + Math.sin(2 * Math.PI));
        System.out.println("(c) Math.cos(2 * Math.PI) = " + Math.cos(2 * Math.PI));
        System.out.println("(d) Math.pow(2, 2) = " + Math.pow(2, 2));
        System.out.println("(e) Math.log(Math.E) = " + Math.log(Math.E));
        System.out.println("(f) Math.exp(1) = " + Math.exp(1));
        System.out.println("(g) Math.max(2, Math.min(3, 4)) = " + Math.max(2, Math.min(3, 4)));
        System.out.println("");
        
        System.out.println("(h) Math.rint(-2.5) = " + Math.rint(-2.5));
        System.out.println("(h2) Math.rint(-2.6) = " + Math.rint(-2.6));
        System.out.println("(h2) Math.rint(-2.51) = " + Math.rint(-2.51));
        System.out.println("");
        
        System.out.println("(i) Math.ceil(-2.5) = " + Math.ceil(-2.5));
        System.out.println("(i2) Math.ceil(-2.6) = " + Math.ceil(-2.6));
        System.out.println("(i2) Math.ceil(-2.51) = " + Math.ceil(-2.51));
        System.out.println("");
        
        System.out.println("(j) Math.floor(-2.5) = " + Math.floor(-2.5));
        System.out.println("(j2) Math.floor(-2.4) = " + Math.floor(-2.4));
        System.out.println("(j2) Math.floor(-2.51) = " + Math.floor(-2.51));
        System.out.println("");
        
        System.out.println("(k) Math.round(-2.5f) = " + Math.round(-2.5f));
        System.out.println("(k) Math.round(-2.6f) = " + Math.round(-2.6f));
        System.out.println("(k) Math.round(-2.51) = " + Math.round(-2.51));
        System.out.println("(l) Math.round(-2.5) = " + Math.round(-2.5));
        System.out.println("(l) Math.round(-2.6) = " + Math.round(-2.6));
        System.out.println("");
        
        System.out.println("(m) Math.rint(2.5) = " + Math.rint(2.5));
        System.out.println("(m) Math.rint(2.51) = " + Math.rint(2.51));
        System.out.println("");
        
        System.out.println("(n) Math.ceil(2.5) = " + Math.ceil(2.5));
        System.out.println("(o) Math.floor(2.5) = " + Math.floor(2.5));
        System.out.println("(p) Math.round(2.5f) = " + Math.round(2.5f));
        System.out.println("(q) Math.round(2.5) = " + Math.round(2.5));
        System.out.println("(q) Math.round(Math.abs(-2.5)) = " + Math.round(Math.abs(-2.5)));
        System.out.println("(q) Math.abs(-2.5)) = " + Math.abs(-2.5));
        
    }
    
}
