This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Math.log10()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Itโ€™s been available across browsers since โจ2015๋…„ 7์›”โฉ.

Math.log10() ์ •์  ๋ฉ”์„œ๋“œ๋Š” ์ˆซ์ž์˜ ๋ฐ‘์ด ๊ธฐ๋ณธ 10์ธ ๋กœ๊ทธ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

โˆ€x>0,๐™ผ๐šŠ๐š๐š‘.๐š•๐š˜๐š๐Ÿท๐Ÿถ(๐šก)=log10(x)=the unique y such that 10y=x\forall x > 0,;\mathtt{\operatorname{Math.log10}(x)} = \log_{10}(x) = \text{the unique } y \text{ such that } 10^y = x

์‹œ๋„ํ•ด ๋ณด๊ธฐ

console.log(Math.log10(100000));
// Expected output: 5

console.log(Math.log10(2));
// Expected output: 0.3010299956639812

console.log(Math.log10(1));
// Expected output: 0

console.log(Math.log10(0));
// Expected output: -Infinity

๊ตฌ๋ฌธ

js
Math.log10(x)

๋งค๊ฐœ๋ณ€์ˆ˜

x

0๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™์€ ์ˆซ์ž์ž…๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜ ๊ฐ’

x์˜ ๋ฐ‘์ด ๊ธฐ๋ณธ 10์ธ ๋กœ๊ทธ. x < 0์ด๋ฉด NaN๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

์„ค๋ช…

log10()์ด Math์˜ ์ •์  ๋ฉ”์„œ๋“œ์ด๊ธฐ ๋•Œ๋ฌธ์— ์ƒ์„ฑํ•œ Math ๊ฐ์ฒด์˜ ๋ฉ”์„œ๋“œ๊ฐ€ ์•„๋‹Œ ํ•ญ์ƒ Math.log10()๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค (Math๋Š” ์ƒ์„ฑ์ž๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค).

์ด ํ•จ์ˆ˜๋Š” Math.log(x) / Math.log(10)์™€ ๋™์ผํ•ฉ๋‹ˆ๋‹ค. log(e)์˜ ๊ฒฝ์šฐ, 1 / Math.LN10์ธ ์ƒ์ˆ˜ Math.LOG10E๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์ œ

Math.log10() ์‚ฌ์šฉ

js
Math.log10(-2); // NaN
Math.log10(-0); // -Infinity
Math.log10(0); // -Infinity
Math.log10(1); // 0
Math.log10(2); // 0.3010299956639812
Math.log10(100000); // 5
Math.log10(Infinity); // Infinity

๋ช…์„ธ์„œ

Specification
ECMAScriptยฎ 2026 Language Specification
# sec-math.log10

๋ธŒ๋ผ์šฐ์ € ํ˜ธํ™˜์„ฑ

๊ฐ™์ด ๋ณด๊ธฐ