Converter to 64 bit double precision IEEE 754 binary floating point standard system: converting base ten decimal numbers

Convert decimal numbers from base ten to 64 bit double precision IEEE 754 binary floating point standard

Latest decimal numbers converted from base ten to 64 bit double precision IEEE 754 binary floating point standard

75.75 = 0 - 100 0000 0101 - 0010 1111 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 May 28 23:53 UTC (GMT)
-23,540 = 1 - 100 0000 1101 - 0110 1111 1101 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 May 28 23:44 UTC (GMT)
-0.75 = 1 - 011 1111 1110 - 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 May 28 23:26 UTC (GMT)
-64.99 = 1 - 100 0000 0101 - 0000 0011 1111 0101 1100 0010 1000 1111 0101 1100 0010 1000 1111 May 28 23:21 UTC (GMT)
-5 = 1 - 100 0000 0001 - 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 May 28 23:15 UTC (GMT)
-48.02837 = 1 - 100 0000 0100 - 1000 0000 0011 1010 0001 1010 0000 1100 1111 0001 1000 0000 0000 May 28 22:59 UTC (GMT)
63.25 = 0 - 100 0000 0100 - 1111 1010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 May 28 22:58 UTC (GMT)
-128 = 1 - 100 0000 0110 - 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 May 28 22:58 UTC (GMT)
6 = 0 - 100 0000 0001 - 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 May 28 22:46 UTC (GMT)
-381 = 1 - 100 0000 0111 - 0111 1101 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 May 28 22:33 UTC (GMT)
-31.999 = 1 - 100 0000 0011 - 1111 1111 1111 1011 1110 0111 0110 1100 1000 1011 0100 0011 1001 May 28 22:21 UTC (GMT)
4,562 = 0 - 100 0000 1011 - 0001 1101 0010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 May 28 22:04 UTC (GMT)
1.745459324156344 = 0 - 011 1111 1111 - 1011 1110 1101 0110 0110 1100 0001 1001 1011 1111 1111 0000 0100 May 28 21:50 UTC (GMT)

How to convert decimal numbers from the decimal system to 64 bit double precision IEEE 754 binary floating point standard

Follow the steps below to convert a base 10 decimal number to 64 bit double precision IEEE 754 binary floating point:

  • 1. If number to be converted is negative, we start with the positive version of the number.
  • 2. First convert the integer part. Divide repeatedly by 2 the positive representation of the integer number that is to be converted to binary, keeping track of each remainder. STOP when the last quotient of the operations is ZERO.
  • 3. Construct the base 2 representation of the positive integer part of the number, by taking all the remainders starting from the bottom of the list constructed above. Thus, the last remainder of the divisions becomes the first symbol (the leftmost) of the base two number, while the first remainder becomes the last symbol (the rightmost).
  • 4. Then convert the fractional part. Multiply repeatedly by 2, keeping track of each integer part of the results
  • 5. Construct the base 2 representation of the fractional part of the number, by taking all the integer parts of the multiplying operations, starting from the top of the constructed list (in the order they have been calculated).
  • 6. Normalize the binary representation of the number, shifting the decimal point n positions to the left (or, if the case, to the right) so that only one non zero decimal place is left in the number.
  • 7. Adjust the exponent in 11 bit excess/bias notation and then convert it from decimal (base 10) to 11 bit binary, by using the same technique of repeatedly dividing by 2, as shown above:
    Exponent (adjusted) = Exponent (unadjusted) + 2(11-1) - 1
  • 8. Normalize mantissa, remove the leading (leftmost) bit, since it's allways '1' (and the decimal sign) and adjust its length to 52 bits, by removing the excess bits, from the right (losing precision...) or adding '0' bits.
  • 9. Sign (1 bit) is 1, if it's a negative number or 0, if it's a positive number.

Example: convert negative number -31.640 215 from decimal system (base ten) to 64 bit double precision IEEE 754 binary floating point:

  • 1. Start with the positive version of the number: |-31.640 215| = 31.640 215
  • 2. First convert the integer part, 31. Divide repeatedly by 2, keeping track of each remainder:
  • iteration division quotient remainder
    1 31 : 2 = 15 1
    2 15 : 2 = 7 1
    3 7 : 2 = 3 1
    4 3 : 2 = 1 1
    5 1 : 2 = 0 1
    Last quotient is ZERO => FULL STOP
  • 3. Construct the base 2 representation of the integer part of the number, by taking all the remainders starting from the bottom of the list constructed above:
    31(10) = 1 1111(2)
  • 4. Then convert the fractional part, 0.640 215. Multiply repeatedly by 2, keeping track of each integer part of the results:
  • # multiplying integer fractional part
    1 0.640 215 x 2 = 1 0.280 43
    2 0.280 43 x 2 = 0 0.560 86
    3 0.560 86 x 2 = 1 0.121 72
    4 0.121 72 x 2 = 0 0.243 44
    5 0.243 44 x 2 = 0 0.486 88
    6 0.486 88 x 2 = 0 0.973 76
    7 0.973 76 x 2 = 1 0.947 52
    8 0.947 52 x 2 = 1 0.895 04
    9 0.895 04 x 2 = 1 0.790 08
    10 0.790 08 x 2 = 1 0.580 16
    11 0.580 16 x 2 = 1 0.160 32
    12 0.160 32 x 2 = 0 0.320 64
    13 0.320 64 x 2 = 0 0.641 28
    14 0.641 28 x 2 = 1 0.282 56
    15 0.282 56 x 2 = 0 0.565 12
    16 0.565 12 x 2 = 1 0.130 24
    17 0.130 24 x 2 = 0 0.260 48
    18 0.260 48 x 2 = 0 0.520 96
    19 0.520 96 x 2 = 1 0.041 92
    20 0.041 92 x 2 = 0 0.083 84
    21 0.083 84 x 2 = 0 0.167 68
    22 0.167 68 x 2 = 0 0.335 36
    23 0.335 36 x 2 = 0 0.670 72
    24 0.670 72 x 2 = 1 0.341 44
    25 0.341 44 x 2 = 0 0.682 88
    26 0.682 88 x 2 = 1 0.365 76
    27 0.365 76 x 2 = 0 0.731 52
    28 0.731 52 x 2 = 1 0.463 04
    29 0.463 04 x 2 = 0 0.926 08
    30 0.926 08 x 2 = 1 0.852 16
    31 0.852 16 x 2 = 1 0.704 32
    32 0.704 32 x 2 = 1 0.408 64
    33 0.408 64 x 2 = 0 0.817 28
    34 0.817 28 x 2 = 1 0.634 56
    35 0.634 56 x 2 = 1 0.269 12
    36 0.269 12 x 2 = 0 0.538 24
    37 0.538 24 x 2 = 1 0.076 48
    38 0.076 48 x 2 = 0 0.152 96
    39 0.152 96 x 2 = 0 0.305 92
    40 0.305 92 x 2 = 0 0.611 84
    41 0.611 84 x 2 = 1 0.223 68
    42 0.223 68 x 2 = 0 0.447 36
    43 0.447 36 x 2 = 0 0.894 72
    44 0.894 72 x 2 = 1 0.789 44
    45 0.789 44 x 2 = 1 0.578 88
    46 0.578 88 x 2 = 1 0.157 76
    47 0.157 76 x 2 = 0 0.315 52
    48 0.315 52 x 2 = 0 0.631 04
    49 0.631 04 x 2 = 1 0.262 08
    50 0.262 08 x 2 = 0 0.524 16
    51 0.524 16 x 2 = 1 0.048 32
    52 0.048 32 x 2 = 0 0.096 64
    53 0.096 64 x 2 = 0 0.193 28
    No fractionary part that was equal to zero has been obtained through calculations. But we have enough iterations (over Mantissa limit = 52) and at least one integer part different of zero was calculated => FULL STOP (losing precision...)
  • 5. Construct the base 2 representation of the fractional part of the number, by taking all the integer parts of the multiplying operations, starting from the top of the constructed list:
    0.640 215(10) = 0.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2)
  • 6. Recap - positive number before normalization:
    31.640 215(10) = 1 1111.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2)
  • 7. Normalize the binary representation of the number, shifting the decimal point 4 positions to the left so that only one non zero decimal place is in the number:
    31.640 215(10) =
    = 1 1111.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2) =
    = 1 1111.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2) * 20 =
    = 1.1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2) * 24
  • 8. Up to this moment, there are the following elements that will feed into the 64 bit double precision IEEE 754 binary floating point:
    Sign: 1 (a negative number)
    Exponent (unadjusted): 4
    Mantissa (non-normalized): 1.1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0
  • 9. Adjust the exponent in 11 bit excess/bias notation and then convert it from decimal (base 10) to 11 bit binary (base 2), by using the same technique of repeatedly dividing by 2, as shown above:
    Exponent (adjusted) = Exponent (unadjusted) + 2(11-1) - 1 =
    = (4 + 1023)(10) = 1027(10) = 100 0000 0011(2)
  • 10. Normalize mantissa, remove the leading (leftmost) bit, since it's allways '1' (and the decimal sign) and adjust its length to 52 bits, by removing the excess bits, from the right (losing precision...):
    Mantissa (normalized): 1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100
  • Conclusion:
    Sign (1 bit) = 1 (a negative number)
    Exponent (8 bits) = 100 0000 0011
    Mantissa (52 bits) = 1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100
  • Number -31.640 215, decimal, converted from decimal system (base 10) to 64 bit double precision IEEE 754 binary floating point = 1 - 100 0000 0011 - 1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100