0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 288 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 288(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 288(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 288.
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 288 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 576;
- 2) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 576 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 152;
- 3) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 152 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 304;
- 4) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 304 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 608;
- 5) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 608 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 216;
- 6) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 216 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 432;
- 7) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 432 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 864;
- 8) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 864 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 321 728;
- 9) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 321 728 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 643 456;
- 10) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 643 456 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 286 912;
- 11) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 286 912 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 573 824;
- 12) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 573 824 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 147 648;
- 13) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 147 648 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 295 296;
- 14) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 295 296 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 590 592;
- 15) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 590 592 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 181 184;
- 16) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 181 184 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 362 368;
- 17) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 362 368 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 724 736;
- 18) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 724 736 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 321 449 472;
- 19) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 321 449 472 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 642 898 944;
- 20) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 642 898 944 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 285 797 888;
- 21) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 285 797 888 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 571 595 776;
- 22) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 571 595 776 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 143 191 552;
- 23) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 143 191 552 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 286 383 104;
- 24) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 286 383 104 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 572 766 208;
- 25) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 572 766 208 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 145 532 416;
- 26) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 145 532 416 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 291 064 832;
- 27) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 291 064 832 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 582 129 664;
- 28) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 582 129 664 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 321 164 259 328;
- 29) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 321 164 259 328 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 642 328 518 656;
- 30) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 642 328 518 656 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 284 657 037 312;
- 31) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 284 657 037 312 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 569 314 074 624;
- 32) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 569 314 074 624 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 138 628 149 248;
- 33) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 138 628 149 248 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 277 256 298 496;
- 34) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 277 256 298 496 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 554 512 596 992;
- 35) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 554 512 596 992 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 109 025 193 984;
- 36) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 109 025 193 984 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 218 050 387 968;
- 37) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 218 050 387 968 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 436 100 775 936;
- 38) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 436 100 775 936 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 320 872 201 551 872;
- 39) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 320 872 201 551 872 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 641 744 403 103 744;
- 40) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 641 744 403 103 744 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 283 488 806 207 488;
- 41) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 283 488 806 207 488 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 566 977 612 414 976;
- 42) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 566 977 612 414 976 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 133 955 224 829 952;
- 43) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 133 955 224 829 952 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 267 910 449 659 904;
- 44) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 267 910 449 659 904 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 535 820 899 319 808;
- 45) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 535 820 899 319 808 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 071 641 798 639 616;
- 46) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 071 641 798 639 616 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 143 283 597 279 232;
- 47) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 330 143 283 597 279 232 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 286 567 194 558 464;
- 48) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 660 286 567 194 558 464 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 320 573 134 389 116 928;
- 49) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 320 573 134 389 116 928 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 641 146 268 778 233 856;
- 50) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 641 146 268 778 233 856 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 282 292 537 556 467 712;
- 51) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 282 292 537 556 467 712 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 564 585 075 112 935 424;
- 52) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 564 585 075 112 935 424 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 129 170 150 225 870 848;
- 53) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 129 170 150 225 870 848 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 258 340 300 451 741 696;
- 54) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 258 340 300 451 741 696 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 516 680 600 903 483 392;
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 288(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 288(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 288(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 288 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