Книга: Advanced PIC Microcontroller Projects in C

1.22.1 Normalizing Floating Point Numbers

1.22.1 Normalizing Floating Point Numbers

Floating point numbers are usually shown in normalized form. A normalized number has only one digit before the decimal point (a hidden number 1 is assumed before the decimal point).

To normalize a given floating point number, we have to move the decimal point repeatedly one digit to the left and increase the exponent after each move.

Some examples follow.

Example 1.32

Normalize the floating point number 123.56

Solution 1.32

If we write the number with a single digit before the decimal point we get:

1.2356 ? 10?

Example 1.33

Normalize the binary number 1011.12

Solution 1.33

If we write the number with a single digit before the decimal point we get:

1.0111 ? 2?

Оглавление книги


Генерация: 1.054. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз