Книга: Advanced PIC Microcontroller Projects in C
1.22 Converting a Floating Point Number into Decimal
Разделы на этой странице:
To convert a given floating point number into decimal, we have to find the mantissa and the exponent of the number and then convert into decimal as just shown. Some examples are given here.
Example 1.30
Find the decimal equivalent of the floating point number: 0 10000001 10000000000000000000000
Solution 1.30
Here
sign = positive
exponent = 129 – 127 = 2
mantissa = 2-1 = 0.5
The decimal equivalent of this number is +1.5 ? 22 = +6.0.
Example 1.31
Find the decimal equivalent of the floating point number: 0 10000010 11000000000000000000
Solution 1.31
In this example,
sign = positive
exponent = 130 – 127 = 3
mantissa = 2-1 + 2-2 = 0.75
The decimal equivalent of the number is +1.75 ? 23 = 14.0.
Похожие страницы
- Numbers
- 1.6 Converting Binary Numbers into Decimal
- 1.7 Converting Decimal Numbers into Binary
- 1.8 Converting Binary Numbers into Hexadecimal
- 1.9 Converting Hexadecimal Numbers into Binary
- 1.10 Converting Hexadecimal Numbers into Decimal
- 1.11 Converting Decimal Numbers into Hexadecimal
- 1.12 Converting Octal Numbers into Decimal
- 1.13 Converting Decimal Numbers into Octal
- 1.14 Converting Octal Numbers into Binary
- 1.15 Converting Binary Numbers into Octal
- 1.16 Negative Numbers