zoukankan      html  css  js  c++  java
  • 吴裕雄--天生自然 JAVA开发学习:Number & Math 类

    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 Test {  
        public static void main (String []args)  
        {  
            System.out.println("90 度的正弦值:" + Math.sin(Math.PI/2));  
            System.out.println("0度的余弦值:" + Math.cos(0));  
            System.out.println("60度的正切值:" + Math.tan(Math.PI/3));  
            System.out.println("1的反正切值: " + Math.atan(1));  
            System.out.println("π/2的角度值:" + Math.toDegrees(Math.PI/2));  
            System.out.println(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));   
      }   
    }

  • 相关阅读:
    linux 创建python虚拟环境
    dic1.update(dic2)和{**dic2, **dic1}的区别
    redis
    电脑开机一卡一卡的,重启就好了
    股东大会和董事会的区别
    word空白框打钩
    计划资产回报
    成本法为什么要转权益法
    租赁负债
    AIDA64序列号
  • 原文地址:https://www.cnblogs.com/tszr/p/10960149.html
Copyright © 2011-2022 走看看