0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 644 Converted to 64 Bit Double Precision IEEE 754 Binary Floating Point Representation Standard
Convert decimal 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 644(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
0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 644(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: 0.
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;
- 0 ÷ 2 = 0 + 0;
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.
0(10) =
0(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 644.
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 644 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 288;
- 2) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 288 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 576;
- 3) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 576 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 152;
- 4) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 152 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 304;
- 5) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 304 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 676 608;
- 6) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 676 608 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 353 216;
- 7) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 353 216 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 706 432;
- 8) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 706 432 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 412 864;
- 9) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 412 864 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 825 728;
- 10) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 825 728 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 651 456;
- 11) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 651 456 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 302 912;
- 12) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 302 912 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 605 824;
- 13) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 605 824 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 211 648;
- 14) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 211 648 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 423 296;
- 15) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 423 296 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 676 846 592;
- 16) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 676 846 592 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 353 693 184;
- 17) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 353 693 184 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 707 386 368;
- 18) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 707 386 368 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 414 772 736;
- 19) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 414 772 736 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 829 545 472;
- 20) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 829 545 472 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 659 090 944;
- 21) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 659 090 944 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 318 181 888;
- 22) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 318 181 888 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 636 363 776;
- 23) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 636 363 776 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 272 727 552;
- 24) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 272 727 552 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 545 455 104;
- 25) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 545 455 104 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 677 090 910 208;
- 26) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 677 090 910 208 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 354 181 820 416;
- 27) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 354 181 820 416 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 708 363 640 832;
- 28) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 708 363 640 832 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 416 727 281 664;
- 29) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 416 727 281 664 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 833 454 563 328;
- 30) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 833 454 563 328 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 666 909 126 656;
- 31) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 666 909 126 656 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 333 818 253 312;
- 32) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 333 818 253 312 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 667 636 506 624;
- 33) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 667 636 506 624 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 335 273 013 248;
- 34) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 335 273 013 248 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 670 546 026 496;
- 35) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 670 546 026 496 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 677 341 092 052 992;
- 36) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 677 341 092 052 992 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 354 682 184 105 984;
- 37) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 354 682 184 105 984 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 709 364 368 211 968;
- 38) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 709 364 368 211 968 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 418 728 736 423 936;
- 39) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 418 728 736 423 936 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 837 457 472 847 872;
- 40) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 837 457 472 847 872 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 674 914 945 695 744;
- 41) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 674 914 945 695 744 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 349 829 891 391 488;
- 42) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 349 829 891 391 488 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 699 659 782 782 976;
- 43) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 699 659 782 782 976 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 399 319 565 565 952;
- 44) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 399 319 565 565 952 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 798 639 131 131 904;
- 45) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 798 639 131 131 904 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 677 597 278 262 263 808;
- 46) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 677 597 278 262 263 808 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 355 194 556 524 527 616;
- 47) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 355 194 556 524 527 616 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 710 389 113 049 055 232;
- 48) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 710 389 113 049 055 232 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 420 778 226 098 110 464;
- 49) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 420 778 226 098 110 464 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 841 556 452 196 220 928;
- 50) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 841 556 452 196 220 928 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 683 112 904 392 441 856;
- 51) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 683 112 904 392 441 856 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 366 225 808 784 883 712;
- 52) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 667 366 225 808 784 883 712 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 732 451 617 569 767 424;
- 53) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 334 732 451 617 569 767 424 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 464 903 235 139 534 848;
- 54) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 669 464 903 235 139 534 848 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 338 929 806 470 279 069 696;
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 644(10) =
0.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 01(2)
5. Positive number before normalization:
0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 644(10) =
0.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 01(2)
6. Normalize the binary representation of the number.
Shift the decimal mark 2 positions to the right, so that only one non zero digit remains to the left of it:
0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 644(10) =
0.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 01(2) =
0.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 01(2) × 20 =
1.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101(2) × 2-2
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): -2
Mantissa (not normalized):
1.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101
8. Adjust the exponent.
Use the 11 bit excess/bias notation:
Exponent (adjusted) =
Exponent (unadjusted) + 2(11-1) - 1 =
-2 + 2(11-1) - 1 =
(-2 + 1 023)(10) =
1 021(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 021 ÷ 2 = 510 + 1;
- 510 ÷ 2 = 255 + 0;
- 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) =
1021(10) =
011 1111 1101(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, only if necessary (not the case here).
Mantissa (normalized) =
1. 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 =
0101 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) =
011 1111 1101
Mantissa (52 bits) =
0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101
Decimal number 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 644 converted to 64 bit double precision IEEE 754 binary floating point representation:
0 - 011 1111 1101 - 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101