Dream_World
2020. 6. 16. 20:45

Math
-
수학적인 상수와 함수를 위한 속성과 메서드를 가진 내장 객체
-
함수 객체가 아님
메소드 (대/소문자 구분 확실히)
Math.round : 소수점 이하를 반올림
Math.round(11.3); //11
Math.round(12.6); //13
Math.round(13.4); //13
Math.round(14.2); //14
Math.round(14.8); //15
Math.sqrt : 루트 값 구하기
Math.sqrt(9); //3
Math.sqrt(16); //4
Math.sqrt(25); //5
Math.sqrt(36); //6
Math.sqrt(49); //7
Math.floor : 소수점 이하를 버림
Math.floor(11.3); //11
Math.floor(12.6); //12
Math.floor(13.4); //13
Math.floor(14.2); //14
Math.floor(14.8); //14
Math.pow : x의 값을 y의 거듭 제곱
Math.pow(2,3); //8
Math.pow(2,4); //16
Math.pow(2,5); //32
Math.pow(2,6); //64
Math.pow(2,7); //128