Rational Numbers: Fractions, Operations, Decimals and Percent
Numbers Fundamentals Computing
Quick answer
A rational number is any number that can be written as a fraction p/q of two integers with q≠0, such as \dfrac34, -\dfrac72 or 5=\dfrac51. Many fractions name the same number (\frac68=\frac34), so you compare, add and multiply them after bringing them to a common form. The decimal expansion of a rational number either terminates (\frac38=0.375) or eventually repeats periodically (\frac13=0.(3 repeating)).
Key takeaways
- A rational number is a ratio of integers; every integer is rational (n=\frac n1), and so is every fraction, terminating decimal and repeating decimal.
- \frac ab=\frac cd exactly when ad=bc; dividing the top and the bottom by their GCD gives the unique lowest-terms form.
- To compare positive fractions, cross-multiply: \frac ab<\frac cd exactly when ad<cb.
- Add and subtract over a common denominator, multiply tops and bottoms, and divide by multiplying by the reciprocal.
- A fraction in lowest terms has a terminating decimal exactly when its denominator has no prime factor except 2 and 5; otherwise the decimal eventually repeats periodically.
- Between any two rational numbers there is another, so there is no next fraction after \frac12.
What is a rational number?
A rational number is a number that can be written as p/q where p and q are integers and q≠0. The set of them is written ℚ, for "quotient", and the word rational comes from ratio, not from "sensible".
In \frac34 the top number p is the numerator and the bottom number q is the denominator: the denominator says into how many equal parts the whole is cut, and the numerator says how many of them are taken.
Several things follow at once:
- Every integer is rational. 5=\frac51 and -3=(-3)/(1). The integers are the rational numbers whose denominator can be 1.
- A number has many fractions. \frac12, \frac24 and (50)/(100) are different ways of writing one number. A fraction is a way of writing; a rational number is the value it names.
- The sign belongs to the whole fraction. -\frac34=(-3)/(4)=(3)/(-4), and by habit the minus is written in front or on the top.
- The denominator is never 0. \frac50 does not name a number.
- Kinds of fraction. A proper fraction is smaller than 1 in size (\frac34), an improper one is not ((17)/(5)), and a mixed number writes an improper one as a whole part plus a proper part (3\frac25).
The rational numbers are closed under all four operations: add, subtract or multiply two of them, or divide by a non-zero one, and the answer is rational again. That is what the integers could not do for division, and it is why fractions were invented. They are not the whole number line, though: √2 and π are real numbers that are not rational, which the article on irrational numbers explains, with the real numbers article as the overview.
Languages say fractions in their own order. In English the numerator comes first ("three quarters"), while Chinese reads the denominator first: 三分之一, "of three parts, one".
Try it: which are rational?
Choose all the rational numbers.
- 3
- -\frac72
- 0.75
- \frac10
- √2
- 0.(3 repeating)
How do you find equivalent fractions and simplify?
Multiplying or dividing the numerator and the denominator by the same non-zero number gives an equivalent fraction, and dividing both by their greatest common divisor gives the lowest terms. Two fractions are equal exactly when \frac ab=\frac cd\iff ad=bc: for example \frac68=\frac34 because 6·4=24=8·3.
The picture is a bar cut into parts. Cut each part into k equal pieces and the bar has k times as many parts, with k times as many shaded, yet the same amount is shaded. Move the sliders to see it.
Simplifying means finding the equivalent fraction with the smallest numbers, the lowest terms, in which the top and the bottom share no factor except 1. Divide both by their greatest common divisor:
(84)/(126): the GCD of 84 and 126 is 42, so (84÷42)/(126÷42)=\dfrac23.
You may also cancel step by step, by any common factor, until nothing is left to cancel. The lowest-terms form is unique, so every route gives the same answer, and for two fractions in lowest terms \frac ab=\frac cd only when a=c and b=d.
Cancel factors, never terms. In 6/8=(2·3)/(2·4) the 2 is a factor of both, so it cancels. In (2+3)/(2+4) the 2s are terms of a sum and do not cancel: the fraction is \frac56, not \frac34. The same care is needed with letters, as in the section on algebraic fractions. Beware also of "canceling" digits: (16)/(64) happens to equal \frac14 when you strike the 6s, and (19)/(95), (26)/(65) and (49)/(98) do the same, but these four are coincidences and the method is wrong, so never rely on it.
Try any fraction below.
Interactive: equivalent fractions as bars
Move three sliders to cut a bar into more equal parts and see that the shaded amount, and so the fraction, does not change.
Interactive: simplify a fraction
Type a fraction and see the greatest common divisor, the lowest terms, the prime factors, the mixed number and the decimal.
Try it: an equivalent fraction
Find a.
How do you compare and order fractions?
To compare two fractions with positive denominators, cross-multiply: \frac ab<\frac cd exactly when ad<cb. For \frac35 and \frac58: 3·8=24 and 5·5=25, and 24<25, so \frac35<\frac58.
Why it works: rewrite both over the common denominator bd, giving (ad)/(bd) and (cb)/(bd). With equal denominators the larger top is the larger fraction.
Shortcuts, when they apply:
- Same denominator: the larger numerator wins, \frac27<\frac57.
- Same numerator: the larger denominator makes the smaller fraction, since the whole is cut into more pieces: \frac13>\frac14.
- Benchmarks: compare each with 0, \frac12 and 1. \frac49<\frac12<\frac47.
- Negative fractions: compare the sizes and reverse, as with integers. \frac12<\frac23 so -\frac12>-\frac23.
To order a list, put them on a number line or give them a common denominator. Between any two different rational numbers lies another: their average 1/2\left(\frac ab+\frac cd\right). So there is no "next" fraction after \frac12, and the rational numbers fill the line without gaps you could ever point to, though √2 shows that the line still holds more: see the number line and density in the article on real numbers. Compare any two below.
Interactive: compare two fractions
Enter two fractions and see which is greater by cross-multiplying, their places on a number line, and a fraction that lies between them.
Try it: order from least to greatest
Put these fractions in order from least to greatest.
Try it: a fraction in between
Find the average of \frac13 and \frac12.
How do you add and subtract fractions?
To add or subtract fractions, rewrite them over a common denominator, then add or subtract the numerators and keep the denominator: \frac ac+\frac bc=(a+b)/(c). You can only add parts that are the same size.
The best common denominator is the least common multiple of the two denominators. For \frac23+\frac34 it is 12:
\dfrac23+\dfrac34=(8)/(12)+(9)/(12)=(17)/(12)=1(5)/(12).
For a subtraction, \dfrac56-\dfrac14=(10)/(12)-(3)/(12)=(7)/(12). If you use b· d instead of the least common multiple the answer is the same, but the numbers are larger and the result needs simplifying afterward.
Never add the denominators. \frac12+\frac13 is not \frac25: the denominators name the size of the pieces, and halves and thirds are different sizes. The right answer is \frac36+\frac26=\frac56. A check is that \frac25=0.4 is less than \frac12, but a sum of two positive numbers is larger than each of them.
Mixed numbers. Either add the whole parts and the fraction parts separately, or turn both into improper fractions first. For 2\frac13+1\frac12: 2+1=3 and \frac13+\frac12=\frac56, so 3\frac56.
Negative fractions follow the sign rules of the integers: \frac12-\frac34=\frac24-\frac34=-\frac14.
Try your own pair below; it shows each line of the working.
Interactive: the four operations on fractions
Add, subtract, multiply or divide two fractions and read the working line by line, down to the simplified answer and its mixed number.
Try it: add fractions
Find a and b.
How do you multiply and divide fractions?
To multiply fractions, multiply the numerators and multiply the denominators: \frac ab·\frac cd=(ac)/(bd); to divide, multiply by the reciprocal of the divisor: \frac ab÷\frac cd=\frac ab·\frac dc. No common denominator is needed for either.
Multiplying: \dfrac34·\dfrac23=(6)/(12)=\dfrac12. It is quicker to cancel first, because a factor on the top of one fraction can cancel with a factor on the bottom of the other: the 3 on the top cancels with the 3 on the bottom, and the 2 on the top with half of the 4, so \frac34·\frac23=(1·1)/(2·1)=\frac12. The word "of" means times: \frac25 of 30 is \frac25·30=12.
Why dividing is multiplying by the reciprocal. Dividing asks how many fit. How many halves fit in 3? 3÷\frac12=6, which is 3·2. In general dividing by \frac cd is the same as multiplying by \frac dc, because multiplying by a number and then by its reciprocal gets you back where you started. Example:
\dfrac34÷\dfrac910=\dfrac34·(10)/(9)=(30)/(36)=\dfrac56.
The reciprocal of \frac cd is \frac dc, and the reciprocal of an integer n is \frac1n. Zero has no reciprocal, so you cannot divide by 0, and dividing by the fraction \frac03 is just as forbidden.
Signs follow the integers: same signs give a positive answer, different signs a negative one, so \left(-\frac12\right)·\left(-\frac23\right)=\frac13. Negative exponents are reciprocals as well, since 2^-3=\frac18, as the section on zero, negative and fractional exponents shows.
Try the calculator above with the other two operations.
Try it: divide fractions
Find a and b in lowest terms.
How do you convert between mixed numbers and improper fractions?
To turn an improper fraction into a mixed number, divide the top by the bottom: the quotient is the whole part and the remainder is the new numerator over the same denominator; to go back, multiply the whole part by the denominator and add the numerator. The only tool is division with remainder, the same one used in the integers article.
| Direction | Steps | Example |
|---|---|---|
| improper → mixed | 17÷5=3 remainder 2 | (17)/(5)=3\frac25 |
| mixed → improper | 3·5+2=17, keep the denominator | 3\frac25=(17)/(5) |
| negative improper → mixed | convert the size, then put the sign in front | -\frac72=-3\frac12 |
In -3\frac12 the minus applies to the whole number: it means -\left(3+\frac12\right)=-3.5, not -3+\frac12. Mixed numbers are fine for reading a quantity, such as 2\frac12 cups, but improper fractions are easier to calculate with, so convert before you multiply or divide.
Try it: a mixed number
Find w and r.
How do fractions become decimals and percentages?
To turn a fraction into a decimal, divide the top by the bottom; the decimal terminates exactly when the denominator, in lowest terms, has no prime factor other than 2 and 5, and otherwise it eventually repeats periodically. Ten is 2·5, so only denominators built from 2s and 5s fit into a power of ten.
| Fraction | Decimal | Why |
|---|---|---|
| \frac38 | 0.375 | 8=2^3, terminates after 3 digits |
| (7)/(20) | 0.35 | 20=2^2·5, terminates after 2 digits |
| \frac13 | 0.(3 repeating) | 3 is neither 2 nor 5 |
| (5)/(12) | 0.41(6 repeating) | 12=2^2·3: 2 digits, then 6 repeats |
| \frac17 | 0.(142857 repeating) | a block of 6 digits repeats |
Two numbers describe the repeat. The digits before it number \max(x,y) when the denominator is 2^x·5^y· q with q coprime to 10 (that is why \frac512 has 2). The block is as long as the number of 10s you need to multiply to get a remainder of 1 modulo q: 1 for \frac13, 6 for \frac17 and for \frac113, 16 for \frac117, 96 for \frac197. It always eventually repeats because long division has fewer than q possible remainders, so one must come back. The proof, and how to turn a repeating decimal back into a fraction, are in the rational numbers section of the real numbers article; the same conversion is a sum of a geometric series.
Percent means "per hundred": p\%=(p)/(100). To convert a fraction, divide to get the decimal and shift the point two places: \frac38=0.375=37.5\%. To convert back, 25\%=(25)/(100)=\frac14.
Percentages apply to a base. A 200 dollar jacket with 15% off costs 85% of 200, which is 0.85·200=170 dollars. A rise of 20% followed by a fall of 20% does not return to the start, because the second percentage is of a larger number: 100→120→96.
Type any fraction below to see its decimal and why it looks that way. The same rule holds in other bases: in base 2 only denominators that are powers of 2 terminate, as the article on binary numbers shows.
Interactive: from fraction to decimal and percent
Type a fraction and see its decimal, whether it ends or repeats and why, the length of the repeating block, and the percentage.
Try it: terminates or repeats?
Which of these fractions has a terminating decimal?
- \frac16
- \frac27
- \frac38
- \frac512
How do ratios and proportions use rational numbers?
A ratio a:b compares two quantities and is the fraction \frac ab; a proportion says two ratios are equal, \frac ab=\frac cd, and is solved by cross-multiplying: ad=bc. Problems that scale a recipe, convert a map distance or price a quantity are all proportions.
| Situation | Setup | Answer |
|---|---|---|
| A recipe uses 3 cups of flour for 12 cookies. How much for 20 cookies? | (3)/(12)=(x)/(20), so 12x=60 | x=5 cups |
| 5 kg of rice cost 20 dollars. How much do 3 kg cost? | (20)/(5)=y/3, so 5y=60 | y=12 dollars |
| A class has 30 students and \frac25 of them walk to school. How many walk? | \frac25·30 | 12 students |
| A map scale is 1:50000. A road is 4 cm on the map. | 4·50000=200000 cm | 2 km |
Two habits prevent most mistakes. Keep the same quantity on the same level of every fraction, flour over cookies on both sides. And check that the answer is sensible: 20 cookies need more flour than 12, so 5 cups is plausible but 2 cups is not. A unit rate is the ratio per one: 20 dollars for 5 kg is 4 dollars per kilogram, and then any quantity is the unit rate times the amount.
Try it: a proportion
3 cups of flour make 12 cookies. How many cups make 20?
How do you work with fractions in Python and JavaScript?
Python has an exact fraction type, fractions.Fraction, that keeps numerator and denominator as integers; JavaScript has none, and its / always produces a binary floating-point number. Floats store only the nearest binary value, so \frac13 and even \frac110 cannot be held exactly: see the floating-point section of the real numbers article.
>>> from fractions import Fraction
>>> Fraction(6, 8) # reduced automatically
Fraction(3, 4)
>>> Fraction(1, 3) + Fraction(1, 6)
Fraction(1, 2)
>>> Fraction(3, 4) / Fraction(9, 10)
Fraction(5, 6)
>>> Fraction(-7, 2).numerator, Fraction(-7, 2).denominator
(-7, 2)
>>> float(Fraction(1, 3))
0.3333333333333333
>>> 0.1 + 0.2 == 0.3
False
>>> Fraction(1, 10) + Fraction(2, 10) == Fraction(3, 10)
True
>>> Fraction(0.1) # the float 0.1 is not one tenth
Fraction(3602879701896397, 36028797018963968)
>>> Fraction('0.1') # the text 0.1 is
Fraction(1, 10)
>>> Fraction(1, 0)
ZeroDivisionError: Fraction(1, 0)0.1 + 0.2 // 0.30000000000000004
3 / 4 // 0.75: JavaScript has no integer division
const gcd = (a, b) => (b === 0n ? (a < 0n ? -a : a) : gcd(b, a % b))
const frac = (n, d) => {
const g = gcd(n, d)
return d < 0n ? [-n / g, -d / g] : [n / g, d / g]
}
const add = ([a, b], [c, d]) => frac(a * d + c * b, b * d)
add(frac(1n, 3n), frac(1n, 6n)) // [1n, 2n]#include <iostream>
#include <cstdio>
using namespace std;
int gcd(int a, int b) { return b == 0 ? (a < 0 ? -a : a) : gcd(b, a % b); }
void show(int n, int d) { // a fraction in lowest terms
if (d == 0) { cout << "undefined: the denominator is 0" << endl; return; }
if (d < 0) { n = -n; d = -d; }
int g = gcd(n, d);
cout << n / g << "/" << d / g << endl;
}
int main() {
show(6, 8); // 3/4: reduced
show(1 * 6 + 1 * 3, 3 * 6); // 1/3 + 1/6 = 1/2
show(3 * 10, 4 * 9); // (3/4) / (9/10) = 5/6
show(-7, 2);
show(1, 0);
printf("%.16f\n", 1.0 / 3); // float(1/3)
cout << (0.1 + 0.2 == 0.3) << endl; // 0: the floats are not equal
cout << (1 * 10 + 2 * 10 == 3 * 10) << endl; // 1: with whole numbers (tenths) they are
printf("%.20f\n", 0.1); // the float 0.1 is not one tenth
return 0;
}
/* output:
3/4
1/2
5/6
-7/2
undefined: the denominator is 0
0.3333333333333333
0
1
0.10000000000000000555
*/The pitfalls, in order of how often they bite:
| Pitfall | What happens | What to do |
|---|---|---|
3 / 4 in Python 3 | 0.75, a float; 3 // 4 is 0 | use Fraction(3, 4) for an exact value |
Fraction(0.1) | the exact value of the float, not 1/10 | pass a string, Fraction('0.1'), or two integers |
| Money in floats | 0.1 + 0.2 is not 0.3 | store whole cents as integers, or use decimal.Decimal |
| Comparing floats | == fails by a hair | compare with a tolerance, or compare Fractions |
Fraction(1, 0) | ZeroDivisionError | check the denominator first |
| Fractions in JavaScript | no built-in type | keep two BigInts and reduce with the GCD, as above |
| Huge denominators | repeated addition can make numbers grow | reduce after every step; Fraction does it for you |
Use Fraction when you need an exact answer from exact input, and floats when speed matters and a tiny rounding error is harmless.
Where do fractions come from?
Fractions are among the oldest mathematics: the Egyptians used them around 1550 BCE, and our way of writing them was assembled over about three thousand years.
- Egypt. The Rhind Papyrus writes almost every fraction as a sum of different unit fractions (numerator 1): \frac25=\frac13+\frac115. Only a few, such as \frac23, had a symbol of their own.
- India and the Arab world. Fractions were written with one number above the other. Arab mathematicians added the dividing bar.
- Europe. Fibonacci's Liber Abaci (1202) used the fraction bar and helped spread the Hindu-Arabic numerals in Europe.
- Decimals. Simon Stevin's De Thiende (1585) argued for writing fractions in tenths, hundredths and thousandths, which is the decimal notation we use.
Today the same numbers show up as fractions in a recipe, as decimals on a calculator, as percentages in a shop and as ratios on a map: one idea with four faces.
What are the common mistakes with fractions?
The most common mistakes with fractions are the nine below, each with the correct statement and a number that shows why.
| Mistake | Correct |
|---|---|
| ❌ \frac12+\frac13=\frac25 | \frac12+\frac13=\frac56. Never add the denominators. |
| ❌ (2+3)/(2+4)=\frac34 | Terms do not cancel: 5/6 is already simplest. |
| ❌ \frac13<\frac14 because 3<4 | A larger denominator means smaller parts: \frac13>\frac14. |
| ❌ \frac34÷\frac910=(3·9)/(4·10) | Flip the divisor: \frac34·(10)/(9)=\frac56. |
| ❌ a/b·c/d=(ac)/(b+d) | Multiply the bottoms too: (ac)/(bd). |
| ❌ -3/4=(-3)/(-4) | (-3)/(-4)=+\frac34. Move one minus sign only. |
| ❌ \frac50=0 | A denominator of 0 is not allowed: \frac50 is not a number. |
| ❌ 3\frac12=3·\frac12 | 3\frac12=3+\frac12=\frac72. |
| ❌ 0.(3 repeating)≠\frac13 because its expansion is infinite | 0.(3 repeating)=\frac13 exactly: a repeating decimal is a fraction. |
Practice: test your understanding
These questions mix everything above. A wrong answer costs nothing here: read the hint and try again.
True or false?
Decide whether each statement is True or False.
- Every integer is a rational number.
- \frac34+\frac14=\frac48.
- 0.(3 repeating) is a rational number.
- \frac13>\frac12.
- \left(-\frac12\right)·\left(-\frac12\right)=-\frac14.
Select all that apply
Choose all the fractions equal to \frac34.
- \frac68
- \frac912
- (12)/(16)
- \frac45
- \frac38
Subtract fractions
Find a and b.
A fraction of a number
What is \frac25 of 45?
A percentage
What is (3)/(20) as a percentage?
- 30\%
- 15\%
- 20\%
- 6.67\%
Sharing equally
\frac34 of a liter of juice is shared equally among 3 glasses. How much is in each?
- \frac94 L
- \frac14 L
- \frac112 L
- \frac37 L
Summary: rational numbers at a glance
- Rational: \frac pq with integers p,q and q≠0; every integer is rational; a number has many fractions, one in lowest terms.
- Equal fractions: \frac ab=\frac cd\iff ad=bc; divide top and bottom by the GCD to simplify; cancel factors, never terms.
- Compare: cross-multiply; the larger denominator makes the smaller piece; between two rationals lies their average.
- Add and subtract: common denominator (the LCM), then combine the tops; never add the denominators.
- Multiply and divide: tops times tops, bottoms times bottoms; divide by flipping the second fraction; zero has no reciprocal.
- Mixed numbers: divide with remainder to convert; -3\frac12=-\left(3+\frac12\right).
- Decimals: a lowest-terms fraction terminates exactly when the denominator has only 2s and 5s; otherwise it eventually repeats periodically; p\%=\frac p100.
- Code: use
Fractionfor exactness in Python; floats cannot hold \frac110.
Glossary: key terms
- Rational number
- A number that can be written as a fraction of two integers with a non-zero denominator, such as 3 over 4 or minus 7 over 2.
- Fraction
- A way of writing a number as a numerator over a denominator, which names how many equal parts are taken out of how many.
- Numerator
- The top number of a fraction, which says how many parts are taken.
- Denominator
- The bottom number of a fraction, which says how many equal parts the whole is cut into and can never be zero.
- Equivalent fractions
- Different fractions that name the same number, such as 1 over 2 and 2 over 4, found by multiplying or dividing the top and bottom by the same number.
- Lowest terms
- A fraction whose numerator and denominator share no factor except 1, found by dividing both by their greatest common divisor.
- Proper and improper fraction
- A proper fraction is smaller than 1 in size, like 3 over 4; an improper fraction is 1 or more in size, like 17 over 5.
- Mixed number
- A whole number together with a proper fraction, such as 3 and 2 over 5, which means 3 plus 2 over 5.
- Reciprocal
- The fraction turned upside down; a number times its reciprocal is 1, and zero has no reciprocal.
- Common denominator
- A denominator that two fractions are both rewritten over so that they can be added or compared; the least common multiple of the denominators is the smallest choice.
- Terminating decimal
- A decimal expansion with finitely many digits, such as 0.375; a fraction in lowest terms has one exactly when its denominator has only the prime factors 2 and 5.
- Repeating decimal
- A decimal expansion that eventually repeats periodically: from some digit onward a block of digits repeats without end, such as 0.333 and so on for 1 over 3.
- Percent
- A fraction with denominator 100, so that 25 percent means 25 over 100, which is 1 over 4.
- Ratio
- A comparison of two quantities written a to b or as the fraction a over b.
Frequently asked questions
What is a rational number?
A rational number is any number that can be written as a fraction p over q, where p and q are integers and q is not zero. Examples are 3 over 4, minus 7 over 2, and every integer, since 5 equals 5 over 1.
Is every integer a rational number?
Yes. Any integer n can be written as n over 1, which is a fraction of two integers with a non-zero denominator. So the integers are a part of the rational numbers, and the rational numbers add the fractions between them.
What is the difference between a fraction and a rational number?
A fraction is a way of writing, a numerator over a denominator, while a rational number is the value that writing names. Many fractions, such as 1 over 2, 2 over 4 and 50 over 100, name the same rational number.
How do you simplify a fraction?
Divide the numerator and the denominator by their greatest common divisor. For 84 over 126 the greatest common divisor is 42, so the fraction simplifies to 2 over 3. You may also cancel common factors step by step, but never common terms.
How do you compare two fractions?
Cross-multiply. To compare a over b with c over d, when b and d are positive, compare a times d with c times b. For 3 over 5 and 5 over 8 that is 24 against 25, so 3 over 5 is smaller. You can also use a common denominator.
How do you add fractions with different denominators?
Rewrite both over a common denominator, preferably the least common multiple, then add the numerators and keep the denominator. For 2 over 3 plus 3 over 4 use 12: 8 over 12 plus 9 over 12 is 17 over 12. Never add the denominators.
Why do you flip the second fraction when you divide?
Because dividing by a number is the same as multiplying by its reciprocal. Dividing asks how many fit: three divided by one half is 6, which is 3 times 2. In general a over b divided by c over d equals a over b times d over c.
How do you convert an improper fraction to a mixed number?
Divide the numerator by the denominator. The quotient is the whole part and the remainder becomes the new numerator over the same denominator. For 17 over 5, 17 divided by 5 is 3 remainder 2, so it is 3 and 2 over 5.
How do you turn a fraction into a decimal?
Divide the numerator by the denominator, by long division or a calculator. For 3 over 8 that gives 0.375. If the division never terminates, the digits eventually repeat periodically, as 1 over 3 gives 0.333 and so on, written with a bar over the repeating digit.
When does a fraction give a terminating decimal?
When, in lowest terms, its denominator has no prime factor other than 2 and 5, because ten is 2 times 5. So 3 over 8 and 7 over 20 terminate, while 1 over 3, 1 over 6 and 5 over 12 repeat, since their denominators contain 3.
Is 0.333 repeating the same as one third?
Yes, exactly. A repeating decimal is a different way of writing a fraction. If x is 0.333 and so on, then 10x minus x is 3, so 9x is 3 and x is one third. Three decimal places only approximate it; the infinite repeat equals it.
How do you convert a fraction to a percentage?
Convert it to a decimal and multiply by 100, or rewrite it with denominator 100. For 3 over 8 the decimal is 0.375, so it is 37.5 percent. For 3 over 20, multiplying top and bottom by 5 gives 15 over 100, which is 15 percent.
Why can a denominator not be zero?
A fraction a over b means the number that gives a when multiplied by b. With b equal to 0, nothing times 0 gives a when a is not 0, and when a is also 0 every number would work. So division by zero has no single answer and is undefined.
How do you use fractions exactly in Python?
Use the Fraction class from the fractions module. It keeps integers for the top and bottom, reduces automatically, and adds, subtracts, multiplies and divides exactly. Pass a string such as 0.1, because Fraction of the float 0.1 holds the float’s binary error.
References
- James Stewart, Lothar Redlin and Saleem Watson (2016). Precalculus: Mathematics for Calculus (7th ed.). Cengage Learning.
- Arnold Buffum Chace (1927). The Rhind Mathematical Papyrus. Mathematical Association of America.
- Laurence Sigler (2002). Fibonacci’s Liber Abaci: A Translation into Modern English of Leonardo Pisano’s Book of Calculation. Springer.
- Simon Stevin (1585). De Thiende (The Art of Tenths).
- Florian Cajori (1928). A History of Mathematical Notations. Open Court Publishing Company.
- Python Software Foundation. The Python Standard Library: fractions, rational numbers. docs.python.org. https://docs.python.org/3/library/fractions.html.
Related articles
- Real Numbers: Definition, Types, Examples and Properties: Real numbers explained: definition, types (rational and irrational), examples, properties and the number line, with interactive practice, a proof and FAQ.
- Irrational Numbers: Definition, Examples, Proofs and Approximations: Irrational numbers explained: why √2 is irrational, which roots are, sums and products, π, e, transcendental numbers and fraction approximations, with practice.
- Integers: Number Line, Operations, Divisibility, GCD and LCM: Integers explained: the number line, adding and multiplying negatives, divisibility, primes, GCD and LCM, and remainders, with worked examples and practice.
- Exponents and Radicals: Laws, Rules, Examples and Practice: Exponents and radicals explained: the five laws, zero, negative and fractional exponents, simplifying roots, rationalizing and scientific notation, with practice.