IEEE 754
IEEE 754 is the technical standard that defines how computers represent and calculate with floating-point numbers. Published by the Institute of Electrical and Electronics Engineers (IEEE), it fixes the binary encoding of real numbers so that the same computation gives consistent results across different processors and languages.
The standard splits each number into three fields: a sign bit, an exponent that sets the magnitude, and a significand, also called the mantissa, that carries the precision. A value equals the significand scaled by the base raised to the exponent, with the sign applied. Because the significand holds a fixed number of bits, most real numbers can be stored only as the nearest representable value, which is the origin of rounding error.
IEEE 754 specifies several binary interchange formats of increasing width:
- binary16: The 16-bit half-precision format, used where memory and speed matter more than accuracy.
- binary32: The 32-bit single-precision format common in graphics and machine learning.
- binary64: The 64-bit double-precision format, with 53 bits of precision, that backs Python’s
float. - binary128: The 128-bit quadruple-precision format for demanding numerical work.
Beyond ordinary numbers, the standard reserves encodings for signed zero, positive and negative infinity, and NaN, short for Not a Number. It also defines several rounding rules, with round half to even as the default. The 2008 and 2019 revisions extended the original 1985 standard with decimal formats and further operations.
Related Resources
Tutorial
How to Round Numbers in Python
In this tutorial, you'll learn what kinds of mistakes you might make when rounding numbers and how you can best manage or avoid them. It's a great place to start for the early-intermediate Python developer interested in using Python for finance, data science, or scientific computing.
For additional information on related topics, take a look at the following resources:
- Rounding Numbers in Python (Course)
- Numbers in Python (Tutorial)
- Basic Data Types in Python: A Quick Exploration (Tutorial)
- Representing Rational Numbers With Python Fractions (Tutorial)
- How to Format Floats Within F-Strings in Python (Tutorial)
- Formatting Floats Inside Python F-Strings (Course)
- Rounding Numbers in Python (Quiz)
- Exploring Basic Data Types in Python (Course)
- Basic Data Types in Python: A Quick Exploration (Quiz)
- Format Floats Within F-Strings (Quiz)
By Martin Breuss • Updated July 23, 2026