Rational or Irrational Calculator

Type a number and this tool says whether it is rational or irrational, and why. A fraction, a terminating decimal or a repeating decimal written as 0.8(3) comes back rational with the exact fraction and the subtraction that produces it; a symbolic form such as sqrt(2), cbrt(9), pi, e or phi comes back irrational with the theorem that settles it named. It is explicit about the difference: for sqrt(2) the argument is a proof about integers, while for a typed string of digits the answer is only a reading of that string, since every finite decimal is rational no matter what number it was truncated from. A second tab divides out any fraction and finds the repeating block, showing the remainder cycle that proves a fraction can never expand without a pattern.

Calculator Type
Accepted: a whole number, a fraction like 22/7, a decimal like 0.375, a repeating decimal written 0.8(3), sqrt(n), cbrt(n), n^(p/q), pi, e, phi, ln(n), and any of those times or divided by a rational.
Widget
Widget