Number.POSITIVE_INFINITY
Number.POSITIVE_INFINITY
์์ฑ์ ์์ ๋ฌดํ๋๋ฅผ ๋ํ๋ธ๋ค.
function checkNumber(bigNumber) {
if (bigNumber === Number.POSITIVE_INFINITY) return 'Process number as Infinity';
return bigNumber;
}
checkNumber(Number.MAX_VALUE); // 1.7976931348623157e+308
checkNumber(Number.MAX_VALUE * 2); // "Process number as Infinity"
Description
Number.POSITIVE_INFINITY
์ ๊ฐ์ ์ ์ญ ๊ฐ์ฒด์ธ Infinity
์์ฑ์ ๊ฐ๊ณผ ๊ฐ๋ค.
์ด ๊ฐ์ ์ํ์์์ ๋ฌดํ๋์ ๋ค๋ฅด๊ฒ ํ๋ํ๋ค.
POSITIVE_INFINITY
๋ฅผ ํฌํจํ ์๋ฌด ์์ ์์,POSITIVE_INFINITY
๋ฅผ ๊ณฑํ ๊ฐ์POSITIVE_INFINITY
์ด๋ค.NEGATIVE_INFINITY
๋ฅผ ํฌํจํ ์๋ฌด ์์ ์์,POSITIVE_INFINITY
๋ฅผ ๊ณฑํ ๊ฐ์NEGATIVE_INFINITY
์ด๋ค.์๋ฌด ์์ ์๋ฅผ
POSITIVE_INFINITY
๋ก ๋๋๋ค๋ฉด ์์ ๋ถํธ๋ฅผ ๊ฐ์ง 0์ด ๋๋ค.์๋ฌด ์์ ์๋ฅผ
POSITIVE_INFINITY
๋ก ๋๋๋ค๋ฉด ์์ ๋ถํธ๋ฅผ ๊ฐ์ง 0์ด ๋๋ค.0์
POSITIVE_INFINITY
๋ก ๊ณฑํ๋ค๋ฉด ๊ฒฐ๊ณผ ๊ฐ์NaN
์ด๋ค.NAN
์POSITIVE_INFINITY
๋ก ๊ณฑํ๋ค๋ฉด ๊ฒฐ๊ณผ ๊ฐ์NaN
์ด๋ค.POSITIVE_INFINITY
๋ฅผNEGATIVE_INFINITY
๋ฅผ ์ ์ธํ ์ด๋ค ์์ ๊ฐ์ผ๋ก ๋๋๋ค๋ฉด ๊ฒฐ๊ณผ๊ฐ์NEGATIVE_INFINITY
์ด๋ค.POSITIVE_INFINITY
๋ฅผNEGATIVE_INFINITY
ํน์POSITIVE_INFINITY
๋ก ๋๋๋ค๋ฉด ๊ฒฐ๊ณผ๊ฐ์NaN
์ด๋ค.
Last updated
Was this helpful?