对数计算器 Logarithm Calculator
计算常用对数(log₁₀)、自然对数(ln)与任意底数对数 logb(x)。支持自定义底数与快速校验输入范围。
Compute common log (log10), natural log (ln), and log base b: logb(x). Includes custom base and domain checks.
1. 输入参数 · Inputs
3. 使用说明 · Notes
-
对数是什么?· What is a logarithm?
对数是指数运算的“反函数”。如果 by = x,那么 y = logb(x)。
A logarithm is the inverse of exponentiation. If by = x, then y = logb(x). -
ln 与 log 的区别 · ln vs log
ln(x):以自然常数 e 为底(e≈2.71828),在微积分、增长/衰减模型、连续复利中非常常见。
log10(x):以 10 为底,工程、数量级、分贝(dB)、科学计数法里经常使用。
log2(x):以 2 为底,信息论、比特数、算法复杂度分析中常见。
ln(x): base e, common in calculus and continuous growth/decay. log10(x): base 10, used for orders of magnitude and dB. log2(x): base 2, common in information theory and CS. -
定义域限制(很重要)· Domain rules (important)
对实数对数来说:x 必须大于 0。此外,自定义底数必须满足 b > 0 且 b ≠ 1。
For real-valued logs: x must be > 0. For custom base: b > 0 and b ≠ 1. -
换底公式 · Change of base
若计算器/编程语言只提供 ln 或 log10,也可以通过:
logb(x) = ln(x) / ln(b) = log10(x) / log10(b)。
If you only have ln or log10, use: logb(x) = ln(x)/ln(b) = log10(x)/log10(b). -
快速心算与直觉 · Mental math & intuition
当 x = 1 时:ln(1)=0,log10(1)=0,logb(1)=0(任何有效 b 都成立)。
当 x = b 时:logb(b)=1;当 x = b² 时:logb(b²)=2。
If x=1 then log is 0; if x=b then log is 1; if x=b² then log is 2. -
常见应用场景 · Common use cases
① 数量级/尺度:用 log10 描述“差多少个 10 倍”。
② 增长与复利:用 ln 处理连续增长(例如 ert 模型)。
③ 数据压缩与信息量:log2 用来描述比特数(bits)。
① Orders of magnitude (log10). ② Continuous growth/compounding (ln). ③ Information content (log2). -
关于精度与显示 · Precision & display
本工具使用 JavaScript 浮点数计算,极端大/极端小的数值可能出现科学计数法或微小误差。
你可以通过“显示精度”控制小数位数,便于复制/报告/作业。
This tool uses JavaScript floating-point math; very large/small values may show scientific notation or tiny rounding errors. Use “Display Precision” to control decimals for reporting. -
学习建议 · Study tips
如果你在做指数/对数题,建议把它们放在一起理解:先写出 by=x,再取对数得到 y。
When solving exponent/log problems, pair them: start with by=x, then take logs to isolate y.
免责声明:本工具用于学习与快速估算,不构成任何投资、工程或科研结论依据;如需高精度,请使用专业数学软件/库并进行误差分析。
Disclaimer: For learning and quick estimation only. For high-precision needs, use professional math software/libraries and perform error analysis.
