Student ID : 1151030
Class : 11CTT
Report on
REPRENSENTATION OF THE FLOATING POINT NUMBER
REPRENSENTATION OF THE FLOATING POINT NUMBER
Reference Materials: 1. Wikipedia Encyclopedia 2. Computer Organization and Design (David A. Paterson)
I. INTRODUCTION:
In computer science, we have unsigned and signed integer to represent the integer number, however, it only could be represent the number from 0 to 232-1 (from -231 to 231-1 with the signed one) and it also cannot express the number with fractional part such as 12.345. In brief, people need a kind of data can provide a huge range in value and can let them represent the fractional number. In C++ programing, we must deal with the “Float” number frequently, but we don’t know much about the inside structure. This report is going to represent internal structure and how floating point number works. II. STRUCTURE OF A FLOATING POINT NUMBER: 1. Ideal about the floating point:
The main purpose of type of data is that it provides very large, very small values and lets you represent fractional numbers. Let’s consider an example on math:
191,350,000,000,000 = 1.9135 x 1014
-0.000 000 000 019 135 = -1.9135 x 10-11
Thus all the number can be expressed with a base value and a scaling factor. The scaling factor plays role in moving the decimal point so that the name of “floating point” number is originated from this. With the float number in C++, the computer stores a value in three parts: one represents the precision of value, the other part scales that shows the range of value and other part is the sign of value. Sign | Exponent | Significand | 1 bit m bits n bits
In additional, we need to face to another problem. In math, there are many ways to represent a number such as
123.456 = 12.3456 x 1001 = 1.23456 x 1002 = 0.123456 x 10-01
So we must have a rule to represent all the numbers. This