20.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 609 Converted to 64 Bit Double Precision IEEE 754 Binary Floating Point Representation Standard
Convert decimal 20.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 609(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
20.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 609(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: 20.
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;
- 20 ÷ 2 = 10 + 0;
- 10 ÷ 2 = 5 + 0;
- 5 ÷ 2 = 2 + 1;
- 2 ÷ 2 = 1 + 0;
- 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.
20(10) =
1 0100(2)
3. Convert to binary (base 2) the fractional part: 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 609.
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.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 609 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 218;
- 2) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 218 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 436;
- 3) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 436 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 668 872;
- 4) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 668 872 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 337 744;
- 5) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 337 744 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 675 488;
- 6) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 675 488 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 350 976;
- 7) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 350 976 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 701 952;
- 8) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 701 952 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 403 904;
- 9) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 403 904 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 807 808;
- 10) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 807 808 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 615 616;
- 11) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 615 616 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 231 232;
- 12) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 231 232 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 462 464;
- 13) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 462 464 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 668 924 928;
- 14) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 668 924 928 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 337 849 856;
- 15) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 337 849 856 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 675 699 712;
- 16) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 675 699 712 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 351 399 424;
- 17) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 351 399 424 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 702 798 848;
- 18) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 702 798 848 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 405 597 696;
- 19) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 405 597 696 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 811 195 392;
- 20) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 811 195 392 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 622 390 784;
- 21) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 622 390 784 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 244 781 568;
- 22) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 244 781 568 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 489 563 136;
- 23) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 489 563 136 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 668 979 126 272;
- 24) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 668 979 126 272 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 337 958 252 544;
- 25) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 337 958 252 544 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 675 916 505 088;
- 26) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 675 916 505 088 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 351 833 010 176;
- 27) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 351 833 010 176 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 703 666 020 352;
- 28) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 703 666 020 352 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 407 332 040 704;
- 29) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 407 332 040 704 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 814 664 081 408;
- 30) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 814 664 081 408 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 629 328 162 816;
- 31) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 629 328 162 816 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 258 656 325 632;
- 32) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 258 656 325 632 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 517 312 651 264;
- 33) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 517 312 651 264 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 034 625 302 528;
- 34) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 034 625 302 528 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 069 250 605 056;
- 35) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 069 250 605 056 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 676 138 501 210 112;
- 36) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 676 138 501 210 112 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 352 277 002 420 224;
- 37) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 352 277 002 420 224 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 704 554 004 840 448;
- 38) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 704 554 004 840 448 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 409 108 009 680 896;
- 39) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 409 108 009 680 896 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 818 216 019 361 792;
- 40) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 818 216 019 361 792 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 636 432 038 723 584;
- 41) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 636 432 038 723 584 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 272 864 077 447 168;
- 42) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 272 864 077 447 168 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 545 728 154 894 336;
- 43) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 545 728 154 894 336 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 091 456 309 788 672;
- 44) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 091 456 309 788 672 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 182 912 619 577 344;
- 45) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 182 912 619 577 344 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 676 365 825 239 154 688;
- 46) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 676 365 825 239 154 688 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 352 731 650 478 309 376;
- 47) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 352 731 650 478 309 376 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 705 463 300 956 618 752;
- 48) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 705 463 300 956 618 752 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 410 926 601 913 237 504;
- 49) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 410 926 601 913 237 504 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 821 853 203 826 475 008;
- 50) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 821 853 203 826 475 008 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 643 706 407 652 950 016;
- 51) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 643 706 407 652 950 016 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 287 412 815 305 900 032;
- 52) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 287 412 815 305 900 032 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 574 825 630 611 800 064;
- 53) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 574 825 630 611 800 064 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 149 651 261 223 600 128;
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.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 609(10) =
0.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0(2)
5. Positive number before normalization:
20.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 609(10) =
1 0100.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0(2)
6. Normalize the binary representation of the number.
Shift the decimal mark 4 positions to the left, so that only one non zero digit remains to the left of it:
20.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 609(10) =
1 0100.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0(2) =
1 0100.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0(2) × 20 =
1.0100 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0(2) × 24
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): 4
Mantissa (not normalized):
1.0100 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0
8. Adjust the exponent.
Use the 11 bit excess/bias notation:
Exponent (adjusted) =
Exponent (unadjusted) + 2(11-1) - 1 =
4 + 2(11-1) - 1 =
(4 + 1 023)(10) =
1 027(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 027 ÷ 2 = 513 + 1;
- 513 ÷ 2 = 256 + 1;
- 256 ÷ 2 = 128 + 0;
- 128 ÷ 2 = 64 + 0;
- 64 ÷ 2 = 32 + 0;
- 32 ÷ 2 = 16 + 0;
- 16 ÷ 2 = 8 + 0;
- 8 ÷ 2 = 4 + 0;
- 4 ÷ 2 = 2 + 0;
- 2 ÷ 2 = 1 + 0;
- 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) =
1027(10) =
100 0000 0011(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. 0100 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0 1010 =
0100 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101
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) =
100 0000 0011
Mantissa (52 bits) =
0100 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101
Decimal number 20.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 609 converted to 64 bit double precision IEEE 754 binary floating point representation:
0 - 100 0000 0011 - 0100 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101