/* 
    To view all the output use: java TestMath | more
 */

class TestMath {

    public static void main(String[] args) {
    
        // no constructors
        // Math a = new Math();     // constructors are 'private'
    
        // constants
        System.out.println("E: \t\t\t\t" + Math.E);
        System.out.println("PI: \t\t\t\t" + Math.PI);  
            
        // abs()
        System.out.println("abs(1234.59): \t\t\t" + Math.abs(1234.59) );
        System.out.println("abs(-0.0): \t\t\t" + Math.abs(-0.0) );
        System.out.println("abs(Float.NEGATIVE_INFINITY): \t" +
                              Math.abs(Float.NEGATIVE_INFINITY) );
        System.out.println("abs(Float.NaN): \t\t" + Math.abs(Float.NaN) );
        System.out.println(Math.abs(Integer.MIN_VALUE)); 
        
        // ceil()
        System.out.println("ceil( 9.01): \t\t\t" + Math.ceil(9.01) );
        System.out.println("ceil(-9.01): \t\t\t" + Math.ceil(-9.01) );
        System.out.println("ceil(10): \t\t\t" + Math.ceil(10) );
        System.out.println("ceil(-0.03): \t\t\t" + Math.ceil(-0.03) );
        System.out.println("ceil(Double.NaN): \t\t" + Math.ceil(Double.NaN) );
        
        // floor()
        System.out.println("floor( 9.01): \t\t\t" + Math.floor(9.01) );
        System.out.println("floor(-9.01): \t\t\t" + Math.floor(-9.01) );
        System.out.println("floor(10): \t\t\t" + Math.floor(10) );
        System.out.println("floor(-0.03): \t\t\t" + Math.floor(-0.03) );
        System.out.println("floor(Double.NaN): \t\t" + Math.floor(Double.NaN) );
        
        // min() and max()
        System.out.println("min(-1.5, 1.5): \t\t" + Math.min(-1.5, 1.5) );
        System.out.println("max(-1.5, 1.5): \t\t" + Math.max(-1.5, 1.5) );
        System.out.println("min(-0.0, 0.0): \t\t" + Math.min(-0.0, 0.0) );
        System.out.println("min(Float.NaN, Float.POSITIVE_INFINITY: " +
                            Math.min(Float.NaN, Float.POSITIVE_INFINITY)); 
        
        // random()
        System.out.println("random(): \t\t\t" + Math.random() );
        
        // round()
        System.out.println("round( 1.5): \t\t\t" + Math.round(1.5) );
        System.out.println("round(-1.5): \t\t\t" + Math.round(-1.5) );
        System.out.println("round(Float.NaN): \t\t" + Math.round(Float.NaN) );
        System.out.println("round(Float.NEGATIVE_INFINITY): \t" + 
                            Math.round(Float.NEGATIVE_INFINITY) );                            
        System.out.println("round(Double.POSITIVE_INFINITY): \t" + 
                            Math.round(Double.POSITIVE_INFINITY) );
        System.out.println("round(Float.MAX_VALUE): \t" +
                            Math.round(Float.MAX_VALUE) );                            
        System.out.println("Float.MAX_VALUE: \t\t" + Float.MAX_VALUE);
                        
                                                    
        // sqrt()
        System.out.println("sqrt( 45): \t\t\t" + Math.sqrt(45) );
        System.out.println("sqrt(-45): \t\t\t" + Math.sqrt(-45) );
                                    
        // trig functions
        System.out.println("sin(90): \t\t\t" + Math.sin(90) );
        System.out.println("cos(90): \t\t\t" + Math.cos(90) );
        System.out.println("tan(90): \t\t\t" + Math.tan(90) );
        System.out.println("asin(-0): \t\t\t" + Math.asin(-0) );
        System.out.println("acos(-0): \t\t\t" + Math.acos(-0) );
        System.out.println("atan(90): \t\t\t" + Math.atan(90) );
        System.out.println("toRadians(90) \t\t\t" + Math.toRadians(90) );
        System.out.println("toDegrees(Math.PI/2): \t\t" + Math.toDegrees(Math.PI/2));
        
        // logs
        System.out.println("log(10): \t\t\t" + Math.log(10) );
        System.out.println("log(-10): \t\t\t" + Math.log(-10) );
        System.out.println("log(0.0): \t\t\t" + Math.log(0.0) );
        
        System.out.println("exp(5): \t\t\t" + Math.exp(5) );
        System.out.println("exp(Float.NaN): \t\t" + Math.exp(Float.NaN) );
        System.out.println("exp(Float.POSITIVE_INFINITY): \t" + 
                            Math.exp(Float.POSITIVE_INFINITY) );        
        System.out.println("exp(Float.NEGATIVE_INFINITY): \t" + 
                            Math.exp(Float.NEGATIVE_INFINITY) );
                            
        // IEEEremainder
        System.out.println(" 7 % 2.5: \t\t\t" + ( 7%2.5) );
        System.out.println("-7 % 2.5: \t\t\t" + ( -7%2.5) );
        System.out.println();
        System.out.println("IEEEremainder( 7, 2.5): \t" + Math.IEEEremainder(7,2.5));
        System.out.println("IEEEremainder(-7, 2.5): \t" + Math.IEEEremainder(-7,2.5));

        // rint()
        System.out.println("rint( 5.5): \t\t\t" + Math.rint(5.55) );
        System.out.println("rint(-5.5): \t\t\t" + Math.rint(-5.55) );
        System.out.println("rint( 5.49): \t\t\t" + Math.rint(5.49) );
        System.out.println("rint(-5.49): \t\t\t" + Math.rint(-5.49) );

        // pow()
        System.out.println("pow(2,2): \t\t\t" + Math.pow(2,2));
        
    }

}
