next up previous
Next: IEEE Floating Point Standard Up: Floating Point Previous: Floating Point

Decimal to Floating Point Conversion

To convert a decimal number to binary floating point representation:

  1. Convert the absolute value of the decimal number to a binary integer plus a binary fraction.
  2. Normalize the number in binary scientific notation to obtain m and e.
  3. Set s=0 for a positive number and s=1 for a negative number.

To convert 22.625 to binary floating point:

  1. Convert decimal 22 to binary 10110. Convert decimal 0.625 to binary 0.101. Combine integer and fraction to obtain binary 10110.101.
  2. Normalize binary 10110.101 to obtain tex2html_wrap_inline390 Thus, m = tex2html_wrap_inline392 and e = 4 = tex2html_wrap_inline394 .
  3. The number is positive, so s=0.



CS 301 Class Account
Mon Sep 14 23:38:35 ADT 1998