숫자와 연산
public class Number {
public static void main(String[] args) {
// Operator
System.out.println(6 + 2); // 8
System.out.println(6 - 2); // 4
System.out.println(6 * 2); // 12
System.out.println(6 / 2); // 3
System.out.println(Math.PI); // 3.141592653589793
System.out.println(Math.floor(Math.PI)); // 3.0
System.out.println(Math.ceil(Math.PI)); // 4.0
}
}
더하기 + 빼기 - 곱하기 * 나누기 /
Math. 하게되면 수학과 관련된 여러 명령어들을 볼 수 있다
Math.PI 하면 PI의 값 3.14~~가 출력되고
이 Math.PI 를 Math.floor로 묶어주면 소숫점자리의 값들을 제거해준다
Math.ceil 은 값을 올려주는 것 (.1 이상일 때)