Understanding the rational or irrational number calculator — concept and principle
This calculator decides whether a number is rational or irrational. It handles whole numbers, fractions and terminating decimals, repeating decimals, and roots of the form ᵏ√(p/q). For rational numbers it gives the exact fraction; for all it shows the decimal value and the type of decimal. Use it for algebra and number-sense homework.
How it is calculated
- Whole numbers, fractions and terminating decimals are rational; the decimal is turned into a fraction in lowest terms.
- Repeating decimals are rational: x = 0.1666… gives 100x − 10x = 15, so x = 15/90 = 1/6.
- A root ᵏ√(p/q), with p/q in lowest terms, is rational only if p and q are both perfect k-th powers; otherwise it is irrational.
- A fraction in lowest terms has a terminating decimal exactly when its denominator has no prime factors other than 2 and 5.
The principle
A rational number is any number that can be written as p/q with whole numbers p and q ≠ 0. Long division of p by q can produce only finitely many remainders, so the digits must either stop or start repeating. Conversely, any stopping or repeating decimal can be turned back into a fraction. Irrational numbers are the ones whose decimals never stop and never repeat. For roots, if ᵏ√n were a fraction a/b in lowest terms, then n = aᵏ/bᵏ, which forces n to be a perfect k-th power; that is why √2, √50 and ∛10 are irrational.
Worked example
Default inputs: root of a number, index k = 2, number under the root 50.
- 50 = 50/1 in lowest terms.
- 50 = 2 × 5², which is not a perfect square (the exponent of 2 is odd); 1 is a perfect square.
- Since 50 is not a perfect square, √50 is Irrational.
- √50 = 5√2 ≈ 7.071067812.
- Its decimal never ends and never repeats, so no fraction p/q exists.
How to read the result
"Rational" comes with the exact fraction; use it instead of a rounded decimal. "Irrational" means any decimal you write is an approximation. Any decimal typed in full is rational, because it stops; irrational numbers only appear here through roots or special constants such as π, e and the golden ratio.
Common mistakes
- Thinking a long decimal on a calculator screen is irrational; the screen just cuts it off.
- Calling 22/7 equal to π; it is a rational approximation.
- Assuming every root is irrational; √(9/4) = 3/2 is rational.
- Assuming the sum of two irrational numbers is irrational; √2 + (−√2) = 0.
Frequently asked questions
Is 0 a rational number?
Yes. 0 = 0/1.
Is π rational if I write 3.14159?
3.14159 is rational, but it is only an approximation of π, which is irrational.
Is 0.999… equal to 1?
Yes. With x = 0.999…, 10x − x = 9, so x = 1.
Sources: OpenStax, Prealgebra 2e (2020), §7.1 Rational and Irrational Numbers