← Back to challenges

Solving Exponential Equations With Logarithms

JavaScriptHardalgorithmsnumbersmath

Instructions

Create a function that takes a number a and finds the missing exponent x so that a when raised to the power of x is equal to b.

Examples

solveForExp(4, 1024) ➞ 5

solveForExp(2, 1024) ➞ 10

solveForExp(9, 3486784401) ➞ 10

Notes

a is raised to the power of what in order to equal b?

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Remove the Letters ABC