2. 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 530 914 537 127 759 994 ÷ 2 = 1 765 457 268 563 879 997 + 0;
- 1 765 457 268 563 879 997 ÷ 2 = 882 728 634 281 939 998 + 1;
- 882 728 634 281 939 998 ÷ 2 = 441 364 317 140 969 999 + 0;
- 441 364 317 140 969 999 ÷ 2 = 220 682 158 570 484 999 + 1;
- 220 682 158 570 484 999 ÷ 2 = 110 341 079 285 242 499 + 1;
- 110 341 079 285 242 499 ÷ 2 = 55 170 539 642 621 249 + 1;
- 55 170 539 642 621 249 ÷ 2 = 27 585 269 821 310 624 + 1;
- 27 585 269 821 310 624 ÷ 2 = 13 792 634 910 655 312 + 0;
- 13 792 634 910 655 312 ÷ 2 = 6 896 317 455 327 656 + 0;
- 6 896 317 455 327 656 ÷ 2 = 3 448 158 727 663 828 + 0;
- 3 448 158 727 663 828 ÷ 2 = 1 724 079 363 831 914 + 0;
- 1 724 079 363 831 914 ÷ 2 = 862 039 681 915 957 + 0;
- 862 039 681 915 957 ÷ 2 = 431 019 840 957 978 + 1;
- 431 019 840 957 978 ÷ 2 = 215 509 920 478 989 + 0;
- 215 509 920 478 989 ÷ 2 = 107 754 960 239 494 + 1;
- 107 754 960 239 494 ÷ 2 = 53 877 480 119 747 + 0;
- 53 877 480 119 747 ÷ 2 = 26 938 740 059 873 + 1;
- 26 938 740 059 873 ÷ 2 = 13 469 370 029 936 + 1;
- 13 469 370 029 936 ÷ 2 = 6 734 685 014 968 + 0;
- 6 734 685 014 968 ÷ 2 = 3 367 342 507 484 + 0;
- 3 367 342 507 484 ÷ 2 = 1 683 671 253 742 + 0;
- 1 683 671 253 742 ÷ 2 = 841 835 626 871 + 0;
- 841 835 626 871 ÷ 2 = 420 917 813 435 + 1;
- 420 917 813 435 ÷ 2 = 210 458 906 717 + 1;
- 210 458 906 717 ÷ 2 = 105 229 453 358 + 1;
- 105 229 453 358 ÷ 2 = 52 614 726 679 + 0;
- 52 614 726 679 ÷ 2 = 26 307 363 339 + 1;
- 26 307 363 339 ÷ 2 = 13 153 681 669 + 1;
- 13 153 681 669 ÷ 2 = 6 576 840 834 + 1;
- 6 576 840 834 ÷ 2 = 3 288 420 417 + 0;
- 3 288 420 417 ÷ 2 = 1 644 210 208 + 1;
- 1 644 210 208 ÷ 2 = 822 105 104 + 0;
- 822 105 104 ÷ 2 = 411 052 552 + 0;
- 411 052 552 ÷ 2 = 205 526 276 + 0;
- 205 526 276 ÷ 2 = 102 763 138 + 0;
- 102 763 138 ÷ 2 = 51 381 569 + 0;
- 51 381 569 ÷ 2 = 25 690 784 + 1;
- 25 690 784 ÷ 2 = 12 845 392 + 0;
- 12 845 392 ÷ 2 = 6 422 696 + 0;
- 6 422 696 ÷ 2 = 3 211 348 + 0;
- 3 211 348 ÷ 2 = 1 605 674 + 0;
- 1 605 674 ÷ 2 = 802 837 + 0;
- 802 837 ÷ 2 = 401 418 + 1;
- 401 418 ÷ 2 = 200 709 + 0;
- 200 709 ÷ 2 = 100 354 + 1;
- 100 354 ÷ 2 = 50 177 + 0;
- 50 177 ÷ 2 = 25 088 + 1;
- 25 088 ÷ 2 = 12 544 + 0;
- 12 544 ÷ 2 = 6 272 + 0;
- 6 272 ÷ 2 = 3 136 + 0;
- 3 136 ÷ 2 = 1 568 + 0;
- 1 568 ÷ 2 = 784 + 0;
- 784 ÷ 2 = 392 + 0;
- 392 ÷ 2 = 196 + 0;
- 196 ÷ 2 = 98 + 0;
- 98 ÷ 2 = 49 + 0;
- 49 ÷ 2 = 24 + 1;
- 24 ÷ 2 = 12 + 0;
- 12 ÷ 2 = 6 + 0;
- 6 ÷ 2 = 3 + 0;
- 3 ÷ 2 = 1 + 1;
- 1 ÷ 2 = 0 + 1;
3. Construct the base 2 representation of the positive number:
Take all the remainders starting from the bottom of the list constructed above.
3 530 914 537 127 759 994(10) = 11 0001 0000 0000 0101 0100 0001 0000 0101 1101 1100 0011 0101 0000 0111 1010(2)
4. Determine the signed binary number bit length:
The base 2 number's actual length, in bits: 62.
A signed binary's bit length must be equal to a power of 2, as of:
21 = 2; 22 = 4; 23 = 8; 24 = 16; 25 = 32; 26 = 64; ...
The first bit (the leftmost) is reserved for the sign:
0 = positive integer number, 1 = negative integer number
The least number that is:
1) a power of 2
2) and is larger than the actual length, 62,
3) so that the first bit (leftmost) could be zero
(we deal with a positive number at this moment)
=== is: 64.
5. Get the positive binary computer representation on 64 bits (8 Bytes):
If needed, add extra 0s in front (to the left) of the base 2 number, up to the required length, 64:
3 530 914 537 127 759 994(10) = 0011 0001 0000 0000 0101 0100 0001 0000 0101 1101 1100 0011 0101 0000 0111 1010
6. Get the negative integer number representation:
To get the negative integer number representation on 64 bits (8 Bytes),
... change the first bit (the leftmost), from 0 to 1...
Number -3 530 914 537 127 759 994(10), a signed integer number (with sign),
converted from decimal system (from base 10)
and written as a signed binary (in base 2):
-3 530 914 537 127 759 994(10) = 1011 0001 0000 0000 0101 0100 0001 0000 0101 1101 1100 0011 0101 0000 0111 1010
Spaces were used to group digits: for binary, by 4, for decimal, by 3.