Log in Sign up
Back to Discover
🔢

Floating-point arithmetic

math Maturity 7-9

Computers use math to work.

Float example.svg
Float example.svg
They can use very big numbers. They can use very small numbers too. This helps them do hard jobs. It is like magic! Can you find numbers everywhere?

35 words

Computers use special math to work.

Float example.svg
Float example.svg
They can show very big numbers. They can show very tiny numbers too. This is like a dot that can float. The dot moves to change the size. This helps computers do fast math. They can even measure things in space. It is a clever way to count.
Z3 Deutsches Museum.JPG
Z3 Deutsches Museum.JPG
Computers use these tools every day.

79 words

Computers need to handle all kinds of numbers.

Float example.svg
Float example.svg
They must count tiny atoms and huge galaxies. To do this, they use floating-point arithmetic. This is a way to show numbers with a dot. We call this dot a radix point. It can "float" to different spots. This makes it like scientific notation.

A floating-point number has two main parts. The first part is the significand. This is a string of digits. The second part is the exponent. The exponent tells the dot where to move. If the exponent is large, the number is big. If the exponent is small, the number is tiny.

Most computers use base two for this math. Some use base ten. Sometimes, the math is not perfect. A computer might have to round a number. This happens when a number has too many digits.

FloatingPointPrecisionAugmented.png
FloatingPointPrecisionAugmented.png
Special parts in a computer help with this. We call these parts floating-point units, or FPUs. They make the math happen very fast.

178 words

Computers must work with numbers that are incredibly different in size. They might measure the tiny distance between protons in an atom. They might also measure the huge distance between distant galaxies.

Float example.svg
Float example.svg
To handle these extremes, computers use floating-point arithmetic. This system lets a computer represent very large and very small numbers using a fixed number of digits. It works much like scientific notation that you might use in science class. This method allows the computer to process math very quickly.

A floating-point number is made of two main parts. The first part is called the significand. This is a sequence of digits that shows the most important parts of the number. The second part is the exponent. The exponent tells the radix point, or the decimal dot, where to move.

FloatingPointPrecisionAugmented.png
FloatingPointPrecisionAugmented.png
If the exponent is a large positive number, the dot moves to the right to make a huge number. If the exponent is a negative number, the dot moves to the left to make a tiny number. This "floating" dot is why we call it floating-point.

Because computers have limited space, they cannot always be perfect. Sometimes a math result has more digits than the computer can store. In these cases, the computer must use rounding. It picks the nearest representable number to keep the math going.

Float example.svg
Float example.svg
This means the numbers are not spaced out perfectly evenly. The gap between two numbers changes depending on the exponent. Most computers today use base two, which is called binary. However, some systems use base ten, which is the decimal system we use every day.

People have been working on these ideas for a long time. In 1914, a Spanish engineer named Leonardo Torres Quevedo published an analysis of floating point. He looked at these ideas using the concept of an analytical engine. Later, the IEEE 754 Standard for Floating-Point Arithmetic was established in 1985. This created a common way for computers to handle these numbers. Since the 1990s, most computers have used these IEEE representations.

Quevedo 1917.jpg
Quevedo 1917.jpg

Doing this math can be a hard job for a computer's brain. Some computers use special hardware called a Floating-Point Unit, or FPU. People sometimes call these math coprocessors.

Z3 Deutsches Museum.JPG
Z3 Deutsches Museum.JPG
If a computer does not have an FPU, it can use software to do the math instead. The speed of these operations is often measured in FLOPS. This measurement is very important for computers that do heavy math. It helps us understand how fast a system can solve big problems.

437 words

Floating-point arithmetic is a method used by computers to represent and calculate real numbers. In mathematics, numbers can be incredibly vast or microscopically small. A computer might need to measure the distance between distant galaxies or the tiny space between protons in an atom.

Float example.svg
Float example.svg
Because computers have limited memory, they cannot store every possible digit of every number. Floating-point arithmetic solves this by using a system of approximation. This allows a computer to handle a huge dynamic range of values while maintaining fast processing speeds.

To understand how this works, think of scientific notation. A floating-point number is logically composed of two distinct parts: the significand and the exponent. The significand, also called the mantissa or coefficient, is a signed string of digits. The length of this significand determines the precision of the number. The exponent is a signed integer that modifies the magnitude of the number.

FloatingPointPrecisionAugmented.png
FloatingPointPrecisionAugmented.png
The exponent tells the computer where to place the radix point, which is the dot used to separate whole numbers from fractions. By changing the exponent, the radix point can "float" to different positions, which gives the system its name.

In practice, the computer calculates the value by multiplying the significand by the base raised to the power of the exponent. Most modern computers use base two, or binary, though some use base ten, known as decimal floating point. If the exponent is positive, the radix point shifts to the right, creating a larger number. If the exponent is negative, the point shifts to the left, creating a smaller number. This mechanism allows the same number of digits to represent vastly different orders of magnitude.

Float example.svg
Float example.svg

Because the significand has a fixed length, the system cannot always represent a number perfectly. For example, the fraction 1/3 results in an infinite string of repeating digits in both decimal and binary. If a math operation produces a result with more digits than the system allows, the computer must use rounding. It identifies the nearest representable floating-point number to complete the calculation. This means that floating-point numbers are not uniformly spaced on a number line. The gap between two consecutive numbers changes depending on the value of the exponent.

The history of these ideas stretches back over a century. In 1914, the Spanish engineer Leonardo Torres Quevedo published an analysis of floating point based on the concept of an analytical engine.

Quevedo 1917.jpg
Quevedo 1917.jpg
As computing technology advanced, the need for a universal standard became clear. In 1985, the IEEE 754 Standard for Floating-Point Arithmetic was established. Since the 1990s, the most common computer representations have followed these IEEE standards. This standardization ensures that different computers can perform math in a consistent way.

Performing these complex calculations requires significant computational power. Some systems use software implementations, often called "softfloat," to handle the math. However, most modern computers include a dedicated hardware component called a Floating-Point Unit, or FPU. These are sometimes called math coprocessors because they are specially designed for these operations.

Z3 Deutsches Museum.JPG
Z3 Deutsches Museum.JPG
The speed of these operations is a critical metric for high-performance computers. This speed is commonly measured in FLOPS, which stands for floating-point operations per second. This measurement is vital for applications that require intensive mathematical modeling.

While floating-point arithmetic is the most common method, other systems exist for specific needs. Fixed-point representation uses a set position for the radix point, which is often used in simpler embedded processors. There are also logarithmic number systems, which represent numbers using their logarithms. Some specialized software uses rational arithmetic to represent numbers as exact fractions, avoiding the need for approximation entirely. Even so, floating-point arithmetic remains the standard for most general-purpose computing due to its unique balance of speed and range.

635 words
🖼️ Images & Media (8)
File:Z3 Deutsches Museum.JPG
Z3 Deutsches Museum.JPG
File:A number line representing single-precision floating point's numbers and numbers that it cannot display.png
A number line representing...
File:FloatingPointPrecisionAugmented.png
FloatingPointPrecisionAugmented.png
File:Quevedo 1917.jpg
Quevedo 1917.jpg
File:Konrad Zuse (1992).jpg
Konrad Zuse (1992).jpg
File:William Kahan 2008.jpg
William Kahan 2008.jpg
File:Float example.svg
Float example.svg
File:Resistors in Parallel.svg
Resistors in Parallel.svg
Up Next
🔢
Real number
Math
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.