Welcome to Rational Numbers and Terminating Decimals, the first course in your learning path through the real number system! Since this is our very first lesson together, we are starting right at the foundation. By the end of this lesson, we will have a clear and confident understanding of what a rational number is, and we will be able to spot one no matter how it is dressed up: as a whole number, a fraction, a negative value, or a familiar decimal.
The Everyday Numbers Around Us
Before we write any formal definitions, let's pause and notice something. Think about the numbers that show up in daily life: the price on a coffee cup ($3.50), the temperature outside (−2), a half-cup of flour (21), or the number of eggs in a carton (). These numbers look quite different from one another. Some have decimal points, some have fraction bars, and some are just plain whole numbers.
What Makes a Number Rational?
A rational number is any number that can be written as a fraction of two integers, where the bottom integer is not zero. In mathematical notation, we say a number r is rational if it can be expressed as:
r=ba,
Integers as Rational Numbers
One of the most common surprises for new learners is that every integer is already a rational number. Consider the number 7. We can write it as:
7=17
The numerator is 7 (an integer), and the denominator is (a nonzero integer). That satisfies our definition perfectly. The same idea works for negative integers and zero:
Signed Fractions and Finite Decimals
Fractions with negative signs are rational as well, because the negative sign simply makes the numerator (or denominator) a negative integer. For example, −43 can be viewed as 4. Both and are integers, and , so the definition is satisfied.
Recognizing Rational Numbers at a Glance
Now that we have explored each form individually, let's bring them together into a quick-reference checklist. When someone hands you a number and asks, "Is it rational?", your job is to determine whether it can be written as ba with integer a, integer b, and . Here is how the most common forms map to that test:
Conclusion and Next Steps
In this lesson we established the definition of a rational number: any value that can be written as ba where both a and b are integers and . We saw that integers, signed fractions, and finite decimals all belong to this set, even though they look very different on the surface. This idea will be the foundation for everything else in the course, from converting fractions to decimals to understanding why some decimals terminate while others repeat.
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal
12
Despite their different appearances, all of these examples belong to one big family of numbers. That family has a name, and learning it is the whole point of this lesson.
where
a
and
b
are integers and
b
=
0
That's the entire definition. The word rational comes from "ratio," because we are describing a ratio of two whole numbers. The key requirements are:
The numeratora must be an integer (…, −2, −1, 0, 1, 2, …).
The denominatorb must also be an integer, and it cannot be zero (dividing by zero is undefined).
As long as a number can be rewritten to fit that template, it qualifies as rational.
1
Number
Written as ba
Rational?
7
17
Yes
−3
1−3
Yes
0
10
Yes
So whenever we see a plain integer, we can place it over 1 to reveal its rational form. This small trick is worth remembering — it means the set of rational numbers is much larger than most people first assume.
−3
−3
4
4=0
What about a decimal like 0.25? We can convert it using place value. The digit 25 sits in the hundredths place, so:
0.25=10025=41
Once we reach 41, we clearly have an integer over a nonzero integer. The same logic applies to any decimal that ends after a finite number of digits — for instance, 1.99=100199 and 0.50=10050=21. Each of these is rational because each can be expressed as a fraction of two integers.
b=0
Form
Example
How to Express as ba
Integer
5, −12, 0
Place over 1: 15, 1,
Simple fraction
32, 5−7
Finite decimal
0.75, 3.00
Use place value: 10075,
If the number fits any of these patterns, the answer is yes — it is rational. Notice that the definition does not care whether the fraction is positive, negative, simplified, or not. All that matters is that such a fraction exists.
b=
0
Now it is time to put this knowledge into action! Up next, you will work through practice tasks where you identify rational numbers on sight, match them to their integer-ratio forms, and justify why everyday prices on a grocery receipt are rational. Let's see how sharp that new definition really is.