Using the full toolkit? Read the step-by-step Polynomial Toolkit guide for quartic, cubic, and quadratic workflows, worked examples, and a reminder to keep every root you find.
algebra · MIT License
Overview
Solve a quadratic inequality using its real roots, leading sign, and endpoint inclusion.
- Owner-tested on a TI calculator
- Version 1.0.0
- 3796 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
- The leading coefficient a is nonzero.
- The program solves quadratics only; a zero leading coefficient is outside its supported input domain.
- An a value of zero stops with a division-by-zero error because the quadratic formula divides by 2a.
Try the DuckieDai calculator screen
Follow the program's prompts and result flow before downloading.
TI-84 Plus CE Python · screen preview
Exact reviewed bytes
Source code
"""DuckieDai Quadratic Inequality Solver for TI-84 Plus CE Python."""from math import sqrtdef duckiedai_intro(program_name, wait=True):title = program_name[:16]empty = 16 - len(title)left = empty // 2right = empty - leftprint("+----------------------+")print("| " + " " * left + title + " " * right + " |")print("| |")print("| __ |")print("| ___(o )> quack! |")print("| \\ <_. ) |")print("| `---' |")print("| by DuckieDai |")print("| hiddenwordscanner.com|")print("+----------------------+")print("Loading...")if wait:input("Press enter to start ")print("\n" * 8)def gcd(a,b):a=abs(a)b=abs(b)while b:a,b=b,a%breturn adef rat(n,d):if d<0:n=-nd=-dg=gcd(n,d)n//=gd//=gif d==1:return str(n)return str(n)+"/"+str(d)def radroot(a,b,d,sgn):# simplify sqrt(d)k=1i=int(sqrt(d))while i>1:if d%(i*i)==0:k=ibreaki-=1r=d//(k*k)A=-bB=sgn*kC=2*ag=gcd(gcd(A,B),C)if g!=0:A//=gB//=gC//=gif C<0:A=-AB=-BC=-Cif abs(B)==1:term="sqrt("+str(r)+")"else:term=str(abs(B))+"*sqrt("+str(r)+")"if A==0:if B<0:top="-"+termelse:top=termelse:if B<0:top=str(A)+"-"+termelse:top=str(A)+"+"+termif C==1:return topreturn "("+top+")/"+str(C)duckiedai_intro("Quad Inequality")a=int(input("a: "))b=int(input("b: "))c=int(input("c: "))print("1 >0")print("2 >=0")print("3 <0")print("4 <=0")op=input("Choice: ")d=b*b-4*a*cif d>0:q=int(sqrt(d))if q*q==d:n1=-b-qn2=-b+qden=2*av1=n1/denv2=n2/dens1=rat(n1,den)s2=rat(n2,den)else:v1=(-b-sqrt(d))/(2*a)v2=(-b+sqrt(d))/(2*a)s1=radroot(a,b,d,-1)s2=radroot(a,b,d,1)if v1>v2:v1,v2=v2,v1s1,s2=s2,s1print("Roots:")print(s1)print(s2)print("Solution:")if a>0:if op=="1":print("(-inf,"+s1+")")print("U ("+s2+",inf)")elif op=="2":print("(-inf,"+s1+"]")print("U ["+s2+",inf)")elif op=="3":print("("+s1+","+s2+")")else:print("["+s1+","+s2+"]")else:if op=="1":print("("+s1+","+s2+")")elif op=="2":print("["+s1+","+s2+"]")elif op=="3":print("(-inf,"+s1+")")print("U ("+s2+",inf)")else:print("(-inf,"+s1+"]")print("U ["+s2+",inf)")elif d==0:s=rat(-b,2*a)print("Root:",s)print("Solution:")if a>0:if op=="1":print("(-inf,"+s+")")print("U ("+s+",inf)")elif op=="2":print("ALL REAL")elif op=="3":print("EMPTY SET")else:print("{"+s+"}")else:if op=="1":print("EMPTY SET")elif op=="2":print("{"+s+"}")elif op=="3":print("(-inf,"+s+")")print("U ("+s+",inf)")else:print("ALL REAL")else:print("No real roots")print("Solution:")if a>0:if op=="1" or op=="2":print("ALL REAL")else:print("EMPTY SET")else:if op=="3" or op=="4":print("ALL REAL")else:print("EMPTY SET")
- Filename
QINQS.py- Size
- 3796 bytes
- SHA-256
90ff0c75184db4cc236faffc540e33191781c872370bbb558d78377f8051218b
Usage
Inputs
- Integer coefficients a, b, and c for ax^2 + bx + c
- One menu choice for strict or inclusive positive or negative results
Outputs
- Roots in simplified rational or radical form
- Interval, singleton, all-real, or empty-set solution
Units: Polynomial coefficients; no physical units.
Assumptions and limitations
Assumptions
- The leading coefficient a is nonzero.
Constraints
- The program solves quadratics only; a zero leading coefficient is outside its supported input domain.
Known failures
- An a value of zero stops with a division-by-zero error because the quadratic formula divides by 2a.
- A menu choice other than 1 to 4 is treated as choice 4.
- Non-integer input uses the calculator Python input error path.
Compatibility and review
- Review status
- Owner-tested on a TI calculator
- Tested on
- Owner reports personally testing 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 DuckieDai opening screen and website line were added. The steps after the opening screen are unchanged and were compared with the owner's file on desktop; this exact file has not yet been rerun on a calculator.
- Dependencies
- math
- Suggested calculator name
QINQS— 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.
QINQSis 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.