E-Code

Fraction calculator: exact, mixed, decimal — a TI-89 Titanium program

By E-Code · updated

FRAC89 is a TI-89 BASIC program for the TI-89 Titanium. Add, subtract, multiply or divide two fractions exactly (pick the operation from a pop-up): the result in lowest terms, its numerator and denominator, as a mixed number, as a decimal, and the least common denominator.

What it asks for and what it shows

It asks for 2 values at its prompts, after you pick option 1 from its menu. In the example below it shows RESULT, NUM, DEN, DECIMAL, LCD, MIXED.

Example run

One of its oracle test cases: “3/4 + 5/6 = 19/12 = 1 7/12”. The inputs are typed in order, and the results are the values the case expects on the screen.

StepValue
You enter
Menuoption 1
Input 13/4
Input 25/6
The screen shows
RESULT=19/12
NUM=19
DEN=12
DECIMAL=1.583333333
LCD=12
MIXED=1 7/12

How it's checked

5 test cases, each checked against an independent method. Replayed key by key on a virtual TI-89 Titanium, they make 37 checks.

How E-Code checks every program

Run it or put it on your calculator

Related programs

All TI-89 Titanium math programs · All TI-89 Titanium programs