Math함수

신형주·2023년 5월 1일
0

자주쓰이는 Math 함수

Math.sqrt(x)
x의 제곱근

Math.random() 0.1~0.99
사이의 랜덤 수

Math.abs(x)
x의 절대값

Math.floor(x) & ceil(x) & round(x)
x의 올림, 내림, 반올림(소수점)

Math.max(x, y) & min(x, y)
x,y중에 최대값, 최소값

Math.pow(x, y) & sqrt(x)
x의 y제곱, x의 제곱근

profile
개발 공부 & 개발하면서 생각나는 것들 기록소

0개의 댓글