07.JavaScript Math객체
○ Math 객체 - 수학과 관련되어 있는 객체 - 수학에서 자주 사용되는 상수, 함수들 사용 가능 - 사용법 : Math.변수명 | Math.함수() document.write(Math.E);//2.718281828459045 document.write(Math.PI);//3.141592653589793 document.write(Math.abs(-3)); //3 절댓값 document.write(Math.max(7, 5, 9, 12)); //12 최댓값 document.write(Math.min(7, 5, 9, 12)); //7 최솟값 document.write(Math.pow(2, 4)); //16 거듭제곱(밑, 지수) ○ 반올림, 올림, 버림 - 반올림 : 소수점 첫 번째 자리에서 반올림 → Ma..
2022. 4. 27.