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()Tier 1 · precalculus
Log Solver
Solve log_b(x)=v for x.
Files (1)
How to use it
Solves log_b(x) = v for x using x = b^v.
Launch LOGSOLVE from prgm, choose 1:SOLVE X, then:
b:— the base of the log.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.
- Run
LOGSOLVE, choose1:SOLVE X. b:→ 2,v:→ 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)
| ID | Inputs | Expected contains |
|---|---|---|
| log10-of-x-eq-2 | 1, 10, 2, 0 | x=100 |
| log2-of-x-eq-3 | 1, 2, 3, 0 | x=8 |