System.out.println(1+1);
System.out.println(1-1);
System.out.println(1*1); //연산자란 숫자 안에있는 +,-, ,*,/ 등의 부호를 연산자(operator)라한다.
System.out.println(1/1);
System.out.println(Math.PI);//=3.141592653589793 math. 라는 그룹안에는 여러가지 수학적 도구들이 있다.
System.out.println(Math.floor(Math.PI)); //=3.0소수내림
System.out.println(Math.ceil(Math.PI)); //=4.0소수올림
//계산기로는 상상도못하는 복잡한 수학적인 작업들을 할 수 있다.
'Programing > java' 카테고리의 다른 글
메서드 Math.pow() ,Math.sqrt()로 두 점의 거리 구하기 (0) | 2022.01.10 |
---|---|
#Java 문자열 다루기 (0) | 2021.09.10 |
#Java 문자열의 표현-Character and string (0) | 2021.09.10 |
프로그래밍 언어에서 데이터를 각각 나눈 이유 (0) | 2021.09.10 |
JAVA의 동작원리 (0) | 2021.09.08 |