[JavaScript] Math 객체


[JavaScript] Math 객체

Math 객체는 수학적인 상수와 내장 함수를 가진 객체로, 숫자 자료형만 지원합니다. 1. Math.round(), Math.ceil(), Math.floor() 숫자에 대한 반올림, 올림, 내림 처리를 하는 함수입니다. console.log(Math.round(4.8)); // 5 console.log(Math.round(4.2)); // 4 console.log(Math.round(-4.8)); // -5 console.log(Math.round(-4.2)); // -4 console.log(Math.ceil(4.8)); // 5 console.log(Math.ceil(4.2)); // 5 console.log(Math.ceil(-4.8)); // -4 console.log(Math.ceil(-4.2)); // -4 console.log(Math.floor(4.8)); // 4 console.log(Math.floor(4.2)); // 4 console.log(Math.floor...


#javascript #math #자바스크립트

원문링크 : [JavaScript] Math 객체