Floating point

computer format for representing real numbers

Real numbers in binary have to be stored in a special way in a computer. Computers represent numbers as binary integers (whole numbers that are powers of two), so there is no direct way for them to represent non-integer numbers like decimals as there is no radix point. One way computers bypass this problem is floating-point representation, with "floating" referring to how the radix point can move higher or lower when multiplied by an exponent (power).

OverviewEdit

In mathematics and science, very large and very small numbers are often made simpler and multiplied to a power of ten to make them easier to understand. For example, it can be much easier to read 1.2 trillion as   than 1,200,000,000,000. This can also be used with negative powers of ten to make small numbers, meaning you can represent   as  . This process is called scientific notation.

Since computers are limited to integers and binary, this means they cannot easily represent fractional decimal numbers. In order to represent fractional numbers, computers use floating point numbers to split a number into two parts with scientific notation: the significand, which is an integer (whole) version of the number, and the exponent, which is the power you multiply the base by.

SignificandEdit

The significand is found by taking the real number and removing the radix point, making it into an integer. For example:   would become  . This is akin to making   into   in decimal, which are very different in meaning but the same digits without a radix point. Similarly to how scientific notation makes the significand as basic as possible, the aim in floating point numbers is to make it an integer so it can be represented in bytes and used in calculations.

ExponentEdit

The exponent is the number of digits the radix point has moved past: if it moves left then the exponent is positive, but if it moves right then it is negative. In the example above, the binary point moved 4 places to the left, so the exponent is   (representing 4 in  ). If the point was to move to the right, such as to represent a fractional number, then the exponent would be negative (e.g. moving right one digit would be   or  ; see negative binary numbers)

ResultEdit

The result is found by putting the significand and exponent together. Using some of the examples from above:

Binary Point Significand Exponent Result
1101 . 0111) 1101 0111 0000 0100 1101 0111 0000 0100
0000.0111 0000 0111 1111 1111 0000 0111 1111 1111

Related pagesEdit