IEEE Standard 754
IEEE Standard 754
IEEE Standard 754
There are several ways to represent floating point number but IEEE 754 is the
most efficient in most cases. IEEE 754 has 3 basic components:
85.125
85 = 1010101
0.125 = 001
85.125 = 1010101.001
=1.010101001 x 2^6
sign = 0
1. Single precision:
biased exponent 127+6=133
133 = 10000101
Normalised mantisa = 010101001
we will add 0's to complete the 23 bits
2. Double precision:
biased exponent 1023+6=1029
1029 = 10000000101
Normalised mantisa = 010101001
we will add 0's to complete the 52 bits
Zero –
Zero is a special value denoted with an exponent and mantissa of 0. -0 and +0
are distinct values, though they both are equal.
Denormalised –
If the exponent is all zeros, but the mantissa is not then the value is a
denormalized number. This means this number does not have an assumed
leading one before the binary point.
Infinity –
The values +infinity and -infinity are denoted with an exponent of all ones and a
mantissa of all zeros. The sign bit distinguishes between negative infinity and
positive infinity. Operations with infinite values are well defined in IEEE.
Not A Number (NAN) –
The value NAN is used to represent a value that is an error. This is represented
when exponent field is all ones with a zero sign bit or a mantissa that it not 1
followed by zeros. This is a special value that might be used to denote a variable
that doesn’t yet hold a value.
EXPONENT MANTISA VALUE
0 0 exact 0
255 0 Infinity
0 not 0 denormalised
255 not 0 Not a number (NAN)
Similar for Double precision (just replacing 255 by 2049), Ranges of Floating
point numbers:
Table of the total effective range of finite IEEE floating-point numbers is shown
below:
BinaryDecimal
Single ± (2 – 2-23) × 2127 approximately ± 1038.53
Double ± (2 – 2-52) × 21023 approximately ± 10308.25
Special Operations –
Operation Result
n ÷ ±Infinity0
±Infinity × ±Infinity ±Infinity
±nonZero ÷ ±0 ±Infinity
±finite × ±Infinity ±Infinity
Infinity + Infinity
Infinity – -Infinity +Infinity
-Infinity – Infinity
-Infinity + – Infinity – Infinity
±0 ÷ ±0 NaN
±Infinity ÷ ±Infinity NaN
±Infinity × 0NaN
NaN == NaN False
"GeeksforGeeks helped me ace the GATE exam! Whenever I had any doubt
regarding any topic, GFG always helped me and made my concepts quiet clear." -
Anshika Modi | AIR 21
Choose GeeksforGeeks as your perfect GATE 2025 Preparation partner with these
newly launched programs
GATE CS & IT- Online
GATE DS & AI- Online
GATE Offline (Delhi/NCR)
Over 150,000+ students already trust us to be their GATE Exam guide. Join them
& let us help you in opening the GATE to top-tech IITs & NITs!
Advantages:
Disadvantages:
Range of values
that can be From -2^(n-1) + 1 to 2^(n-
From -2^(n-1) to 2^(n-1) – 1
represented with n 1) – 1
bits
Number of
Can be represented in two Can be represented in only one
representations for
ways (all 0s and all 1s). way (all 0s).
zero
Addition of positive
Same as unsigned binary Same as unsigned binary
and negative
addition. addition.
numbers