1.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 3 Converted to 64 Bit Double Precision IEEE 754 Binary Floating Point Representation Standard
Convert decimal 1.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 3(10) to 64 bit double precision IEEE 754 binary floating point representation standard (1 bit for sign, 11 bits for exponent, 52 bits for mantissa)
What are the steps to convert decimal number
1.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 3(10) to 64 bit double precision IEEE 754 binary floating point representation (1 bit for sign, 11 bits for exponent, 52 bits for mantissa)
1. First, convert to binary (in base 2) the integer part: 1.
Divide the number repeatedly by 2.
Keep track of each remainder.
We stop when we get a quotient that is equal to zero.
- division = quotient + remainder;
- 1 ÷ 2 = 0 + 1;
2. Construct the base 2 representation of the integer part of the number.
Take all the remainders starting from the bottom of the list constructed above.
1(10) =
1(2)
3. Convert to binary (base 2) the fractional part: 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 3.
Multiply it repeatedly by 2.
Keep track of each integer part of the results.
Stop when we get a fractional part that is equal to zero.
- #) multiplying = integer + fractional part;
- 1) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 3 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 988 6;
- 2) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 988 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 977 2;
- 3) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 977 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 954 4;
- 4) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 954 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 908 8;
- 5) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 908 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 817 6;
- 6) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 817 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 635 2;
- 7) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 635 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 270 4;
- 8) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 270 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 540 8;
- 9) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 540 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 997 081 6;
- 10) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 997 081 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 163 2;
- 11) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 163 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 988 326 4;
- 12) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 988 326 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 976 652 8;
- 13) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 976 652 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 953 305 6;
- 14) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 953 305 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 906 611 2;
- 15) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 906 611 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 813 222 4;
- 16) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 813 222 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 626 444 8;
- 17) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 626 444 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 252 889 6;
- 18) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 252 889 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 505 779 2;
- 19) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 505 779 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 997 011 558 4;
- 20) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 997 011 558 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 023 116 8;
- 21) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 023 116 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 988 046 233 6;
- 22) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 988 046 233 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 976 092 467 2;
- 23) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 976 092 467 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 952 184 934 4;
- 24) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 952 184 934 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 904 369 868 8;
- 25) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 904 369 868 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 808 739 737 6;
- 26) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 808 739 737 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 617 479 475 2;
- 27) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 617 479 475 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 234 958 950 4;
- 28) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 234 958 950 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 469 917 900 8;
- 29) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 469 917 900 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 996 939 835 801 6;
- 30) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 996 939 835 801 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 993 879 671 603 2;
- 31) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 993 879 671 603 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 987 759 343 206 4;
- 32) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 987 759 343 206 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 975 518 686 412 8;
- 33) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 975 518 686 412 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 951 037 372 825 6;
- 34) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 951 037 372 825 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 902 074 745 651 2;
- 35) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 902 074 745 651 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 804 149 491 302 4;
- 36) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 804 149 491 302 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 608 298 982 604 8;
- 37) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 608 298 982 604 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 216 597 965 209 6;
- 38) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 216 597 965 209 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 433 195 930 419 2;
- 39) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 433 195 930 419 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 996 866 391 860 838 4;
- 40) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 996 866 391 860 838 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 993 732 783 721 676 8;
- 41) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 993 732 783 721 676 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 987 465 567 443 353 6;
- 42) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 987 465 567 443 353 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 974 931 134 886 707 2;
- 43) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 974 931 134 886 707 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 949 862 269 773 414 4;
- 44) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 949 862 269 773 414 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 899 724 539 546 828 8;
- 45) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 899 724 539 546 828 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 799 449 079 093 657 6;
- 46) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 799 449 079 093 657 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 598 898 158 187 315 2;
- 47) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 598 898 158 187 315 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 197 796 316 374 630 4;
- 48) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 197 796 316 374 630 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 395 592 632 749 260 8;
- 49) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 998 395 592 632 749 260 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 996 791 185 265 498 521 6;
- 50) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 996 791 185 265 498 521 6 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 993 582 370 530 997 043 2;
- 51) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 993 582 370 530 997 043 2 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 987 164 741 061 994 086 4;
- 52) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 987 164 741 061 994 086 4 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 974 329 482 123 988 172 8;
- 53) 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 974 329 482 123 988 172 8 × 2 = 1 + 0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 948 658 964 247 976 345 6;
We didn't get any fractional part that was equal to zero. But we had enough iterations (over Mantissa limit) and at least one integer that was different from zero => FULL STOP (Losing precision - the converted number we get in the end will be just a very good approximation of the initial one).
4. Construct the base 2 representation of the fractional part of the number.
Take all the integer parts of the multiplying operations, starting from the top of the constructed list above:
0.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 3(10) =
0.1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1(2)
5. Positive number before normalization:
1.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 3(10) =
1.1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1(2)
6. Normalize the binary representation of the number.
Shift the decimal mark 0 positions to the left, so that only one non zero digit remains to the left of it:
1.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 3(10) =
1.1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1(2) =
1.1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1(2) × 20
7. Up to this moment, there are the following elements that would feed into the 64 bit double precision IEEE 754 binary floating point representation:
Sign 0 (a positive number)
Exponent (unadjusted): 0
Mantissa (not normalized):
1.1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1
8. Adjust the exponent.
Use the 11 bit excess/bias notation:
Exponent (adjusted) =
Exponent (unadjusted) + 2(11-1) - 1 =
0 + 2(11-1) - 1 =
(0 + 1 023)(10) =
1 023(10)
9. Convert the adjusted exponent from the decimal (base 10) to 11 bit binary.
Use the same technique of repeatedly dividing by 2:
- division = quotient + remainder;
- 1 023 ÷ 2 = 511 + 1;
- 511 ÷ 2 = 255 + 1;
- 255 ÷ 2 = 127 + 1;
- 127 ÷ 2 = 63 + 1;
- 63 ÷ 2 = 31 + 1;
- 31 ÷ 2 = 15 + 1;
- 15 ÷ 2 = 7 + 1;
- 7 ÷ 2 = 3 + 1;
- 3 ÷ 2 = 1 + 1;
- 1 ÷ 2 = 0 + 1;
10. Construct the base 2 representation of the adjusted exponent.
Take all the remainders starting from the bottom of the list constructed above.
Exponent (adjusted) =
1023(10) =
011 1111 1111(2)
11. Normalize the mantissa.
a) Remove the leading (the leftmost) bit, since it's allways 1, and the decimal point, if the case.
b) Adjust its length to 52 bits, by removing the excess bits, from the right (if any of the excess bits is set on 1, we are losing precision...).
Mantissa (normalized) =
1. 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1 =
1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111
12. The three elements that make up the number's 64 bit double precision IEEE 754 binary floating point representation:
Sign (1 bit) =
0 (a positive number)
Exponent (11 bits) =
011 1111 1111
Mantissa (52 bits) =
1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111
Decimal number 1.999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 999 994 3 converted to 64 bit double precision IEEE 754 binary floating point representation:
0 - 011 1111 1111 - 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111