Rational Number

A rational number is any number that can be expressed as a ratio of two integers (hence the name "rational"). It can be written as a fraction in which the the top number (numerator) is divided by the bottom number (denominator).

All integers are rational numbers since they can be divided by 1, which produces a ratio of two integers. Many floating point numbers are also rational numbers since they can be expressed as fractions. For example, 1.5 is rational since it can be written as 3/2, 6/4, 9/6 or another fraction or two integers. Pi (π) is irrational since it cannot be written as a fraction.

A floating point number is rational if it meets one of the following criteria:

  1. it has a limited number of digits after the decimal point (e.g., 5.4321)
  2. it has an infinitely repeating number after the decimal point (e.g., 2.333333...)
  3. it has an infinitely repeating pattern of numbers after the decimal point (e.g. 3.151515...)

If the numbers after the decimal point repeat infinitely with no pattern, the number is not rational or "irrational." Below are examples of rational and irrational numbers.

  • 1 - rational
  • 0.5 - rational
  • 2.0 - rational
  • √2 - irrational
  • 3.14 - rational
  • π (3.14159265359...) - irrational
  • √4 - rational
  • √5 - irrational
  • 16/9 - rational
  • 1,000,000.0000001 - rational

In computer science, it is significant if a number is rational or irrational. A rational number can be stored as an exact numeric value, while an irrational number must be estimated.

NOTE: The number zero (0) is a rational number because it can be written as 0/1, which equals 0.

Updated June 5, 2018 by Per C.

quizTest Your Knowledge

The printed version of an electronic file is also called what?

Small copy
Large copy
Soft copy
Hard copy
Correct! Incorrect!     View the Hard Copy definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Rational Number on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.