← Library
Tier 1 · precalculus

Log Solver

Solve log_b(x)=v for x.

Files (1)
LOGSOLVE.py247 bytes
def p(s):print(s)
def o1():
 p("=LOG SOLVE=")
 b=float(input("b:"))
 v=float(input("v:"))
 x=b**v
 p("x="+str(x))
def menu():
 while True:
  p("=LOGSOLVE=")
  p("1:SOLVE X")
  p("0:EXIT")
  c=input("?>")
  if c=="1":o1()
  elif c=="0":break
menu()
How to use it

Solves log_b(x) = v for x using x = b^v.

Launch LOGSOLVE from prgm, choose 1:SOLVE X, then:

  1. b: — the base of the log.
  2. v: — the value on the right side of the equation.

Output is x=. Use decimals for non-integer bases (e.g. b=2.71828 for natural log).

Example problem

Solve log₂(x) = 3.

  1. Run LOGSOLVE, choose 1:SOLVE X.
  2. b:2, v:3.
  3. Output: x=8.

Verify: log₂(8) = 3 because 2³ = 8. ✓

TI-84 Plus CE — try before committingoff
TI-84 Plus CE



  (calculator off)

  Press ON to start.
Test cases (2)
IDInputsExpected contains
log10-of-x-eq-21, 10, 2, 0x=100
log2-of-x-eq-31, 2, 3, 0x=8