Wu Yuxiong - natural born JAVA development of learning: Number & Math class

int a = 5000;
float b = 13.65f;
byte c = 0x4a;
public class Test{
 
   public static void main(String args[]){
      Integer x = 5;
      x =  x + 10;
      System.out.println(x); 
   }
}
public  class the Test {  
     public  static  void main (String [] args)   
    {   
        System.out.println ( "sine of 90 degrees:" + Math.sin, (Math.PI / 2 ));   
        System.out.println ( "0 the cosine of: "+ Math.cos (0 ));   
        System.out.println ( " 60 degrees tangent: "+ Math.tan (Math.PI /. 3 ));   
        System.out.println ( ". 1 arctangent: "to Math.atan + (. 1 ));   
        System.out.println ( " angle value π / 2 is: "+ Math.toDegrees (Math.PI / 2 ));   
        System.out.println (the Math .PI);   
    }   
}

public class Main {   
  public static void main(String[] args) {   
    double[] nums = { 1.4, 1.5, 1.6, -1.4, -1.5, -1.6 };   
    for (double num : nums) {   
      test(num);   
    }   
  }   
  
  private static void test(double num) {   
    System.out.println("Math.floor(" + num + ")=" + Math.floor(num));   
    System.out.println("Math.round(" + num + ")=" + Math.round(num));   
    System.out.println("Math.ceil(" + num + ")=" +Math.ceil (num));   
  }    
}

 

Guess you like

Origin www.cnblogs.com/tszr/p/10960149.html