ConceptStep · learning platform for computer science

IEEE 754 precision and rounding

Number systems · Lesson

← ConceptStep

IEEE 754 — precision and rounding

Not every decimal number has a finite binary representation. When more than 23 fraction bits would be required, the value is rounded to the nearest representable float.

Why 0.1 is not exact

In binary, 0.1 produces a repeating fraction. In single precision the stored pattern is:

0 01111011 10011001100110011001101

The stored float, shown with more precision, is 0.10000000149011612. The error relative to 0.1 is 1.4901161138336505E-09.

Adjacent numbers

Every float has adjacent representable values. For 0.1:

previous: 0.09999999403953552
stored: 0.10000000149011612
next: 0.10000000894069672

Practice

Progress: 0/5 — correct: 0.

Is the number 1.5 exactly representable in IEEE 754 single precision?

This fraction has a finite binary representation because, in lowest terms, its denominator is a power of 2.

Your competency map

What you need to know for IEEE 754 — precision

ConceptStep separates what is required from what is recommended or useful as reinforcement. Only required prerequisites block your progress.

Current topic Strong skill Review due Needs reinforcement To be mastered Optional support

Relationships: solid line = required · dashed line = recommended · dotted line = reinforcement.

GUIDED LEARNING PATHS

Want to choose the next skill to develop?