# isInteger

5개의 포스트
post-thumbnail

JavaScript - 정수 판별 함수 Number.isInteger, 제곱근 반환 함수 Math.sqrt

\*프로그래머스 lv.1 약수의 개수와 덧셈 문제 풀이 중위 알고리즘 문제를 풀다가 어떤 수의 제곱근인 정수는 약수의 개수가 홀수라는 개념을 알게 되었다.Number.isInteger(Math.sqrt(x)) == true 인 경우 x의 약수의 개수는 홀수인 셈.Num

2023년 4월 26일
·
0개의 댓글
·
post-thumbnail

[프로그래머스] 제곱수 판별하기

Q. 어떤 자연수를 제곱했을 때 나오는 정수를 제곱수라고 합니다. 정수 n이 매개변수로 주어질 때, n이 제곱수라면 1을 아니라면 2를 return하도록 solution 함수를 완성해주세요.내 풀이 = 다른 사람의 풀이

2023년 2월 21일
·
0개의 댓글
·
post-thumbnail

[JS] converting and checking numbers, Math and rounding, remainder operator,Numeric Separators, bigInt

parseInt, parseFloat => global functionsNumber을 굳이 안붙혀도 되지만, 요즘은 붙혀서 적는 추세!Check if value is NaN. data type이 NaN인지를 확인한다.console.log(Number.isNaN(20))

2021년 12월 21일
·
0개의 댓글
·

JS에서 숫자인지 아닌지 판별하기

function isNumeric(v) { ... } function isInteger(v) { ... } function isPositiveInteger(v) { ... } function isNegativeInteger(v) { ... }

2020년 11월 1일
·
0개의 댓글
·