Exponent Solver

Solve for the exponent from a known base and result using logarithms.

📐 計算公式
解指數方程 aˣ=b(本頁程式碼口徑):x=ln(b)÷ln(a),分母按 |a−1| 分流——接近 1 用 Math.log1p(a−1) 穩定計算,遠離 1 用 Math.log(a) 避免 a−1 抵消;聯動量:回代校驗=aˣ、反推底數=b^(1÷x)(b=1 時 x=0,任意 a≠1 都成立,反推不唯一)、x 與 ln(a) 之比=x÷ln(a)(直接用實際分母,0<a<1 時比值為負)。校驗:a、b 必填且有限;a≤0 或 b≤0 報錯;只有 a 恰等於 1 才拒絕(a=1.0000000000005 等近 1 合法底數可正常求解,僅提示浮點精度限制;b=1 時 x 任意,否則無解)。判據:無固定分級,a>1 時 x 隨 b 單調增、0<a<1 時單調減。

輸入底數 a 與結果 b,求指數 x。

Formula & Standard References

Item Formula / Note Source / Standard
Solving a^x = b x = log_a(b) = ln(b)/ln(a) ISO 80000-2:2019, Quantities and units - Part 2: Mathematics
Existence conditions A unique real solution exists only for a > 0, a ≠ 1, b > 0 ISO 80000-2:2019, Quantities and units - Part 2: Mathematics
Inverse of the logarithm a^(log_a b) = b and log_a(a^x) = x ISO 80000-2:2019, Quantities and units - Part 2: Mathematics
Special value When b = 1 the solution is x = 0 since a^0 = 1 ISO 80000-2:2019, Quantities and units - Part 2: Mathematics
📌 計算說明
  • 以 a 為底 b 的對數。
  • 2^x=8 → x=3。