package com.sf.day13.System;

import java.util.Arrays;
import java.util.Random;

public class Test {
    @org.junit.Test
    public void t1(){
        System.out.println(System.currentTimeMillis());
//        System.exit(0);
//        System.out.println("==========");
        String property = System.getProperty("java.version");
        System.out.println(property);
        System.out.println(System.getProperty("java.home"));
        System.out.println(System.getProperty("os.name"));
        System.out.println(System.getProperty("os.version"));
        System.out.println(System.getProperty("user.name"));
        System.out.println(System.getProperty("user.home"));
        System.out.println(System.getProperty("user.dir"));
        int[] arr1 = {1,2,3,4,5};
        int[] arr2 = new int[10];
        System.arraycopy(arr1,0,arr2,3,arr1.length);
        System.out.println(Arrays.toString(arr1));
        System.out.println(Arrays.toString(arr2));
    }


    @org.junit.Test
    public void t2(){
        System.out.println(Math.abs(-5));  //绝对值
        System.out.println(Math.abs(5));  //绝对值

        //返回大于等于参数的最小整数
        System.out.println(Math.ceil(3.3));  //4.0
        System.out.println(Math.ceil(-3.3));  //-3.0
        System.out.println(Math.ceil(3.9));   //4.0
        //返回小于等于参数的最小整数
        System.out.println(Math.floor(3.3));
        System.out.println(Math.floor(-3.3));
        System.out.println(Math.floor(3.9));

        long d1 = Math.round(5.5); //d1的值为6
        long d2 = Math.round(5.4); //d2的值为5
        long d3 = Math.round(-3.3); //d3的值为-3
        long d4 = Math.round(-3.8); //d4的值为-4
        System.out.println(d1);
        System.out.println(d2);
        System.out.println(d3);
        System.out.println(d4);

        System.out.println(Math.sin(0));
        System.out.println(Math.cos(0));
        System.out.println(Math.sin(30));
//        System.out.println(Math.tan());


    }

    @org.junit.Test
    public void t3(){
        Random random = new Random();
        System.out.println(random.nextInt());
        System.out.println(random.nextDouble());
        System.out.println(random.nextLong());
        System.out.println(random.nextBoolean());
    }
}
