TI-BASIC:Decimal To Fraction2

From Learn @ Cemetech
Jump to navigationJump to search

Routine Summary

Converts a decimal into a fraction


Ans - Decimal input


Ans - Numerator (1), Denominator (2)

Variables Used

A, B, Ans

Calculator Compatibility

TI-83/84/+/SE Author

12Me21 Download

No download provided.

:While fPart(A

It starts by setting up a fraction with the input as the numerator and 1 as the denominator. After that, it multiplies both by 10 until the numerator is an integer, and then simplifies the fraction.

Error Conditions

  • ERR:DATA TYPE is thrown if Ans is an imaginary or complex number
  • ERR:DOMAIN is thrown if Ans has more than 11 digits after the decimal.

Related Routines