Module I: Floating Point Representation
Amlan Dutta∗
Department of Metallurgical and Materials Engineering,
Indian Institute of Technology Kharagpur, West Bengal 721302, India
(Dated: August 5, 2025)
1
Abstract
Scientific computing involves a large number of arithmetic operations. Such operations typically
involve real numbers with integer and fractional parts. Storing and processing of real numbers
in a digital device is done by means of floating point representation. In this module, we shall
gain a quick introduction to the technique of representing real values with finite number of digits.
We shall also learn about the standards and protocols used for such representations. Moreover,
this module also explores various limitations and pitfalls of such representations and attempts to
provide a demonstrative glimpse of the intrinsic distinction between numeric computing and the
logical algorithm based computing strategies.
1. COMPUTER REPRESENTATION OF A FLOATING POINT NUMBER
The floating point representation of a number is different from the real number. While
a real number may be represented exactly as a unique point on the real number line, a
floating point representation requires a finite field size. Thus, every floating point value is a
valid real number, but the reverse is not necessarily true (explained in the class). Any real
number, x, can be represented as,
x = (−1)s × m × β E ,
where
s : 0 or 1,
m : mantissa or significand,
E : exponent, and
β : base of the number system.
As an example, consider the decimal value, 301.22. We can express it as, (301.22)10 =
(−1)0 × 3.0122 × 102 . Accordingly we assign the values, s = 0, m = 3.0122, β = 10 (decimal
number system), and E = 3.
∗
[Link]@[Link]
2
Here we face the issue of standardization, which needs to be addressed before the scheme
can be used without introducing any ambiguity. For instance, we can also represent the
above number as, (301.22)10 = (−1)0 × 30122.0 × 10−2 , so that, s = 0, m = 30122.0, β = 10,
and E = −2. Another possible choice is, s = 0, m = 0.30122, β = 10, and E = 3. Thus,
we can create unlimited combinations of the parameters, each of which would represent the
same value.
In practice, a digital device is bound to offer a finite space to store a floating point
representation in terms of the parameters, s, m, and E. But the demonstration given above
shows that a real value can have multiple representations, if we are free to use arbitrary
combinations of the parameters. A strategy to ensure that each value can have only a
unique floating point representation is imposing the constraint that the mantissa should
always be expressed as,
m = m0 .m1 m2 ...mk , such that 1 ≤ m0 < β.
Therefore, out of the three representations given in the above example, only the first one
remains acceptable and is deemed standardized.
All the modern digital computers store values in binary system, where the base, β = 2.
Sometimes, it is possible to translate a decimal number exactly to binary. For instance,
(9.25)10 = (1001.01)2 . Nonetheless, this is not always the case; a number like (4.2)10
translates to (100.001100110011...)2 . One may note that confining the floating point repre-
sentation to a finite number of bits invariably leads to loss of precision.
A floating point representation would need to store the sign bit, s, the exponent, E, and
the mantissa, m. The significand is only in the form of,
m = b0 .b1 b2 b3 ...,
where each bit, bi , is either 0 or 1. Thus a number like (5.5)10 = (101.1)2 = (−1)0 ×(1.011)2 ×
22 can be stored in the bit–fields as given in Fig. 1.
At this point, we may note that for m = b0 .b1 b2 b3 ..., 1 ≤ b0 < 2, as the base, β = 2.
This implies that b0 has a fixed value of 1 and the significand is always expressed as, m =
1.b1 b2 b3 ...bk . It is known as the normalized form of the binary floating point representation.
3
FIG. 1. A schematic demonstrating the storage of a floating point value in the bit–fields.
2. MACHINE EPSILON
The so called machine epsilon (ϵ) signifies the precision or resolution of the floating
point representation system in a digital computer. It is formally defined as the smallest
representable gap between 1 and the next represented value larger than 1. For instance, let
us consider a toy system, where a floating point value is expressed with only four bits of
manissa, b0 .b1 b2 b3 . In this finite bit-field, 1 is represented as, (1.000)2 . The next smallest
number larger than 1 that can be represented using the 4-bit mantissa is, (1.001)2 . Therefore,
the smallest distinguishing gap is (1.001)2 − (1.000)2 = (0.001)2 = (2−3 )10 , which makes the
machine epsilon, ϵ = 0.125. The system can resolve 1 from the next value 1.125, but it cannot
distinguish it from any value lying between 1 and 1.125. Hence a number like (1.05)10 will
still be represented as 1 in absence of sufficient resolution provided by the available count
of bits in the mantissa.
3. IEEE-754
The full name of this scheme is ANSI/IEEE standard 754–1985. It dictates an inter-
national protocol for binary floating point representation, followed by most of the modern
digital equipment.
The first commonly used protocol is for the single precision representation. Here, each
floating point value is represented using a field of 32 bits. These bits are occupied as follows:
• The first bit is used to store the sign bit, s (0 for positive and 1 for negative).
• The next 8 bits store the exponent, E. Its value may vary from -126 to 127 (further
elaborated in the class).
4
• The last 23 bits are utilized to store the mantissa, m, in the normalized form.
The IEEE-754 also prescribes special provisions for representing 0, ±∞, and N aN .
For many applications in scientific computing, the single precision representation is
deemed insufficient and a bit-field of larger size is necessary to obtain better numerical
resolution. Hence, the double precision standard has been devised with 64 bits of repre-
sentation. Here, apart from the sign bit, 11 bits are reserved for the exponent, while the
mantissa spans 52 bits. The exponent covers a range of -1022 to 1023.
4. HIDDEN BIT NORMALIZATION
The IEEE-754 standard also brings in a powerful feature. Recall that in the normalized
binary format, the mantissa is written as m = b0 .b1 b2 b3 ..., where b0 is compelled to assume
the value of 1 on account of normalization. Evidently, any provision of storing b0 is redundant
and wastage of the bit-field. Hence, the IEEE-754 mandates that the integer part b0 should
not be stored explicitly as its fixed value is known to be 1. Instead, this extra bit-space
should be utilized to store the fractional part of the mantissa, thereby reducing the machine
epsilon and enhancing the resolution. Thus, in single precision, instead of using the 23-bit
mantissa to store 1.b1 b2 b3 ...b22 , we store the value, 1.b1 b2 b3 ...b23 , where the leading bit, 1,
is not explicitly stored but assumed implicitly to exist. This technique is known as hidden
bit normalization. For single precision representation, this trick improves the resolution
(machine epsilon) from 2−22 to 2−23 . One may note that hidden bit normalization seems
to create some issue for storing the value, 0, for which special provision is prescribed in
IEEE-754.
5. ALGEBRAIC PROPERTIES OF FLOATING POINT VALUES
Due to the finite range and resolution of floating point representation, addition and
multiplication of the represented values exhibit commutativity but not associativity.
• fl(x)+fl(y) = fl(y)+fl(x); fl(x).fl(y) = fl(y).fl(x)
• fl(x + y)+fl(z) ̸= fl(x)+fl(y + z); fl(x.y).fl(z) ̸= fl(x).fl(y.z)