3.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 29 Converted to 64 Bit Double Precision IEEE 754 Binary Floating Point Representation Standard
Convert decimal 3.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 29(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
3.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 29(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: 3.
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;
- 3 ÷ 2 = 1 + 1;
- 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.
3(10) =
11(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 328 29.
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 328 29 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 656 58;
- 2) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 656 58 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 313 16;
- 3) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 313 16 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 626 32;
- 4) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 626 32 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 252 64;
- 5) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 252 64 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 505 28;
- 6) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 505 28 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 010 56;
- 7) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 010 56 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 021 12;
- 8) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 021 12 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 042 24;
- 9) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 042 24 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 664 084 48;
- 10) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 664 084 48 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 168 96;
- 11) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 168 96 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 656 337 92;
- 12) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 656 337 92 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 312 675 84;
- 13) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 312 675 84 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 625 351 68;
- 14) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 625 351 68 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 250 703 36;
- 15) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 250 703 36 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 501 406 72;
- 16) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 501 406 72 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 002 813 44;
- 17) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 002 813 44 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 005 626 88;
- 18) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 005 626 88 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 011 253 76;
- 19) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 011 253 76 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 664 022 507 52;
- 20) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 664 022 507 52 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 045 015 04;
- 21) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 045 015 04 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 656 090 030 08;
- 22) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 656 090 030 08 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 312 180 060 16;
- 23) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 312 180 060 16 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 624 360 120 32;
- 24) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 624 360 120 32 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 248 720 240 64;
- 25) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 248 720 240 64 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 497 440 481 28;
- 26) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 497 440 481 28 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 994 880 962 56;
- 27) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 994 880 962 56 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 989 761 925 12;
- 28) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 989 761 925 12 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 331 979 523 850 24;
- 29) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 331 979 523 850 24 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 663 959 047 700 48;
- 30) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 663 959 047 700 48 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 327 918 095 400 96;
- 31) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 327 918 095 400 96 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 655 836 190 801 92;
- 32) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 655 836 190 801 92 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 311 672 381 603 84;
- 33) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 311 672 381 603 84 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 623 344 763 207 68;
- 34) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 623 344 763 207 68 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 246 689 526 415 36;
- 35) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 246 689 526 415 36 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 493 379 052 830 72;
- 36) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 493 379 052 830 72 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 986 758 105 661 44;
- 37) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 986 758 105 661 44 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 973 516 211 322 88;
- 38) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 973 516 211 322 88 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 331 947 032 422 645 76;
- 39) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 331 947 032 422 645 76 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 663 894 064 845 291 52;
- 40) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 663 894 064 845 291 52 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 327 788 129 690 583 04;
- 41) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 327 788 129 690 583 04 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 655 576 259 381 166 08;
- 42) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 655 576 259 381 166 08 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 311 152 518 762 332 16;
- 43) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 311 152 518 762 332 16 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 622 305 037 524 664 32;
- 44) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 622 305 037 524 664 32 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 244 610 075 049 328 64;
- 45) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 244 610 075 049 328 64 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 489 220 150 098 657 28;
- 46) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 489 220 150 098 657 28 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 978 440 300 197 314 56;
- 47) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 332 978 440 300 197 314 56 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 956 880 600 394 629 12;
- 48) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 665 956 880 600 394 629 12 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 331 913 761 200 789 258 24;
- 49) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 331 913 761 200 789 258 24 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 663 827 522 401 578 516 48;
- 50) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 663 827 522 401 578 516 48 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 327 655 044 803 157 032 96;
- 51) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 327 655 044 803 157 032 96 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 655 310 089 606 314 065 92;
- 52) 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 655 310 089 606 314 065 92 × 2 = 1 + 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 310 620 179 212 628 131 84;
- 53) 0.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 310 620 179 212 628 131 84 × 2 = 0 + 0.666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 666 621 240 358 425 256 263 68;
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 328 29(10) =
0.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0(2)
5. Positive number before normalization:
3.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 29(10) =
11.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 1 positions to the left, so that only one non zero digit remains to the left of it:
3.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 29(10) =
11.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0(2) =
11.0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0101 0(2) × 20 =
1.1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 10(2) × 21
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): 1
Mantissa (not normalized):
1.1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 10
8. Adjust the exponent.
Use the 11 bit excess/bias notation:
Exponent (adjusted) =
Exponent (unadjusted) + 2(11-1) - 1 =
1 + 2(11-1) - 1 =
(1 + 1 023)(10) =
1 024(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 024 ÷ 2 = 512 + 0;
- 512 ÷ 2 = 256 + 0;
- 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) =
1024(10) =
100 0000 0000(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. 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 10 =
1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010
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 0000
Mantissa (52 bits) =
1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010
Decimal number 3.333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 328 29 converted to 64 bit double precision IEEE 754 binary floating point representation:
0 - 100 0000 0000 - 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010 1010