exponential functions · MIT License
Overview
Evaluate a logarithm in any base, solve log_b(x) = y for x, or solve log_b(ax+c) = d for x, with a check of the answer.
- Owner-tested on a TI calculator
- Version 1.0.0
- 2793 bytes
- Uses math
Before you run it
- TI-84 Plus CE Python · No calculator OS or Python App version has been verified.
- TI Connect CE .py transfer to the Python App; the owner's transfer details were not recorded
- Logarithms use the change of base formula log_b(x) = ln(x)/ln(b).
- Answers are rounded to six decimal places.
- The base must be greater than 0 and cannot equal 1; the program asks again until it is.
Try the DuckieDai calculator screen
Follow the program's prompts and result flow before downloading.
TI-84 Plus CE Python · screen preview
Learn the math
How logarithms work
The idea
A logarithm answers the question: what power do I raise the base to in order to get this number? Because 2 to the power 3 is 8, the log base 2 of 8 is 3.
That makes a logarithm the inverse of an exponential. Any log equation can be rewritten as a power, and that rewrite is how you solve it.
The formula
log_b(x) = y means b^y = x
log_b(x) = ln(x)/ln(b)
b- the base: positive and not 1
x- the argument: what you take the log of, always positive
y- the logarithm, which is an exponent
Using the program
- 1 evaluates log_b(x) for any base, using the change of base formula.
- 2 solves log_b(x) = y for x by rewriting it as x = b^y.
- 3 solves log_b(ax+c) = d for x and shows a check that ax+c equals b^d.
Worked example
Evaluate the log base 2 of 8. Choose 1 and enter base 2 and x = 8.
log_2(8) = ln(8)/ln(2)
The program shows log_ 2.0 ( 8.0 ) and = 3.0.
Solve log_2(3x - 1) = 5. Choose 3 and enter base 2, a = 3, c = -1, and d = 5. Rewriting gives 3x - 1 = 2^5 = 32, and the program shows x = 11.0 with the check ax+c = 32.0 and b^d = 32.0.
Tips and common mistakes
- The argument of a log must be positive. Always check your answer in the original equation.
- log with no base written usually means base 10, and ln means base e (about 2.718282).
- In ax+c, keep the sign of c: for 3x - 1, c is -1.
Where this comes up
Logarithms are introduced in algebra 2 and are a full unit of precalculus and college algebra. Chemistry uses them for pH, and physics and earth science use them for decibels and earthquake magnitudes.
Exact reviewed bytes
Source code
"""DuckieDai Logarithm Solver for TI-84 Plus CE Python."""from math import logdef intro():print("+----------------------+")print("| LOG SOLVER |")print("| |")print("| __ |")print("| ___(o )> quack! |")print("| \\ <_. ) |")print("| `---' |")print("| by DuckieDai |")print("| hiddenwordscanner.com|")print("+----------------------+")print("Loading...")input("Press enter ")print("\n"*6)def num(prompt):while True:try:return float(input(prompt))except:print("Enter a number.")def base():while True:b = num("Base b? ")if b > 0 and b != 1:return bprint("Base must be")print("> 0 and not 1.")intro()while True:print("LOG SOLVER")print("1: Evaluate log")print("2: log_b(x)=y")print("3: log_b(ax+c)=d")print()mode = input("Choice? ")print("\n"*5)# -----------------# MODE 1# -----------------if mode == "1":print("Evaluate:")print("log_b(x)")print()b = base()while True:x = num("x? ")if x > 0:breakprint("x must be > 0")answer = log(x) / log(b)print("\n"*4)print("RESULT")print("------")print("log_", b, "(", x, ")")print("=", round(answer, 6))# -----------------# MODE 2# -----------------elif mode == "2":print("Solve:")print("log_b(x)=y")print()b = base()y = num("y? ")x = b ** yprint("\n"*4)print("RESULT")print("------")print("x =", round(x, 6))print()print("Because:")print("x = b^y")# -----------------# MODE 3# -----------------elif mode == "3":print("Solve:")print("log_b(ax+c)=d")print()b = base()a = num("a? ")c = num("c? ")d = num("d? ")if a == 0:print()print("a cannot be 0.")else:inside = b ** dx = (inside - c) / aprint("\n"*4)print("RESULT")print("------")print("x =", round(x, 6))print()print("Check:")print("ax+c =", round(a*x+c, 6))print("b^d =", round(inside, 6))else:print("Choose 1, 2, or 3.")print()again = input("Again? y/n: ")if again.lower() != "y":breakprint("\n"*7)print()print("DuckieDai says:")print("done!")
- Filename
LOGSOL.py- Size
- 2793 bytes
- SHA-256
a868e2862d2fac5ddfb6f1d003371e1f58e90b1da4863bcc7f911da555ddb1a6
Usage
Inputs
- One menu choice from 1 to 3
- Base b (positive and not 1)
- The argument x, the value y, or the coefficients a, c, and d
Outputs
- The value of log_b(x) rounded to six decimal places
- The solution x of log_b(x) = y
- The solution x of log_b(ax+c) = d with a check that ax+c equals b^d
Units: Pure numbers; no physical units.
Assumptions and limitations
Assumptions
- Logarithms use the change of base formula log_b(x) = ln(x)/ln(b).
- Answers are rounded to six decimal places.
Constraints
- The base must be greater than 0 and cannot equal 1; the program asks again until it is.
- When evaluating a logarithm, x must be greater than 0.
- In log_b(ax+c) = d, a cannot be 0.
Known failures
- A very large exponent makes b^y or b^d too large for the calculator and stops the program with an error.
- A menu choice other than 1 to 3 shows a reminder and then asks whether to go again.
Compatibility and review
- Review status
- Owner-tested on a TI calculator
- Tested on
- Owner reports personally running this program on a TI-84 Plus CE Python calculator; the test date, OS version, and Python App version were not recorded
- What happened
- Owner reported pass on the calculator before the website line was added to the opening screen and the line endings were normalised. The steps after the opening screen are unchanged; this exact file has not yet been rerun on a calculator.
- Dependencies
- math
- Suggested calculator name
LOGSOL— you can give it another valid, unique name when you transfer it- Desktop test cases
- Not available for this interactive-only source
This exact source auto-launches an interactive calculator session, so compatibility evidence comes from the recorded physical-device review rather than an importable desktop fixture.
Transfer and launch
- Confirm that your calculator is the Python-capable model named above. This release has no verified calculator OS or Python App version; treat transfer and execution as unverified until independently tested.
- Download the
.pysource above and verify its SHA-256 digest if your computer provides that option. - Use TI Connect CE to send the Python file to a compatible calculator.
LOGSOLis a suggested name; you may choose another valid, unique calculator name. - Open the Python App, select the program, and check sample inputs before relying on other results.
Read the complete installation, launch, troubleshooting, and removal guide.
Availability does not mean a teacher, school, or exam permits this program. Follow the applicable rules.
Version history
- 1.0.0 — current version, published . Download this reviewed version
Any source change requires a new immutable version and digest. Historical downloads remain available only while their review records remain valid.
Related learning
Independent compatibility resource: Hidden Word Scanner is independent and is not affiliated with or endorsed by Texas Instruments. TI product names describe compatibility only.
Action-count privacy: Successful downloads, preview starts, and preview completions increment same-origin aggregate counters. No entered values, source text, IP address, account, cookie, device identifier, or fingerprint is stored with these counts.