I have a code to calculate the slope of a line if two points space known; however, it just returns the steep in decimal format. I"d prefer the capacity to pick to transform the decimal to a fraction. Here"s what I"ve excellent so far:

:Disp " ":Input "PAIR 1: ",T:Input "PAIR 2: ",U:((LU(2)-LT(2))/(LU(1)-LT(2)))->M:Disp "Slope Is: ",M:Input "F>>D? Y/N: ",Str0:If Str0="Y":(M>FD)->O:Disp OWhen I run this, I get ERROR: SYNTAX top top the conversion step (the actual slope calculation completes successfully.)

**Some the the password I"ve typed over is not specifically how it shows up in the TI 84, but it"s the ideal I deserve to do through a QWERTY keyboard.


►Frac and ►F◄►D are screen tokens, not conversion tokens

TI calculators can only keep numbers one way: in your proprietary floating-point format. This method that numbers can not be "converted" from portion to decimal or evil versa, only displayed together fractions or decimals. Thus, storing to anything (e.g. 3►F◄►D→X) will throw a syntax error.

You are watching: Ti-83 decimal to fraction

Display settings are adjusted using the Auto/Dec/Frac tokens in the mode menu; ►Frac overrides the mode and also displays as a portion approximation, ►Dec screens as decimal, and ►F◄►D speak the calculator to display screen in the opposite display screen mode from its current setting.

Quoting from this page:

►Frac attempts to display the input in fraction form. It just works top top the home screen outside a program, or through the Disp and also Pause commands in a program.



The trouble is in the line

(M>FD)->ODisp OThere"s no factor to format it this means when it have the right to simply be expressed as

Disp M>FDwhich calculates properly.


One method to convert from decimal to a fraction is to usage the Euclidean Algorithm. Here it is in ti-basic

:Ans→X:{1,abs(Ans:Repeat E‾9>Ans(2:abs(Ans(2){1,fPart(Ans(1)/Ans(2:End:round(X,1/Ans(1),0:Ans/gcd(Ans(1),Ans(2Ans is the decimal you great to convertand E‾9 is the same as 10^(-9)


Thanks for contributing an answer to stack Overflow!

Please be certain to answer the question. Provide details and share your research!

But avoid

Asking because that help, clarification, or responding to other answers.Making statements based upon opinion; ago them increase with referrals or personal experience.

See more: How Much Energy Does It Take To Boil Water ? Heat, Temperature, And Thermal Energy Transfer

To learn more, watch our advice on writing good answers.

write-up Your prize Discard

By clicking “Post her Answer”, friend agree come our terms of service, privacy policy and also cookie plan

Not the answer you're feather for? Browse other questions tagged ti-basic or ask your own question.

site design / logo © 2021 ridge Exchange Inc; user contributions license is granted under cc by-sa. Rev2021.10.14.40466

your privacy

By click “Accept every cookies”, girlfriend agree ridge Exchange deserve to store cookie on your an equipment and disclose info in accordance v our Cookie Policy.