1 111 111 001 111 111 111 111 111 111 101 101 011 110 111 100 083 Converted to 64 Bit Double Precision IEEE 754 Binary Floating Point Representation Standard

Convert decimal 1 111 111 001 111 111 111 111 111 111 101 101 011 110 111 100 083(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
1 111 111 001 111 111 111 111 111 111 101 101 011 110 111 100 083(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. 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;
  • 1 111 111 001 111 111 111 111 111 111 101 101 011 110 111 100 083 ÷ 2 = 555 555 500 555 555 555 555 555 555 550 550 505 555 055 550 041 + 1;
  • 555 555 500 555 555 555 555 555 555 550 550 505 555 055 550 041 ÷ 2 = 277 777 750 277 777 777 777 777 777 775 275 252 777 527 775 020 + 1;
  • 277 777 750 277 777 777 777 777 777 775 275 252 777 527 775 020 ÷ 2 = 138 888 875 138 888 888 888 888 888 887 637 626 388 763 887 510 + 0;
  • 138 888 875 138 888 888 888 888 888 887 637 626 388 763 887 510 ÷ 2 = 69 444 437 569 444 444 444 444 444 443 818 813 194 381 943 755 + 0;
  • 69 444 437 569 444 444 444 444 444 443 818 813 194 381 943 755 ÷ 2 = 34 722 218 784 722 222 222 222 222 221 909 406 597 190 971 877 + 1;
  • 34 722 218 784 722 222 222 222 222 221 909 406 597 190 971 877 ÷ 2 = 17 361 109 392 361 111 111 111 111 110 954 703 298 595 485 938 + 1;
  • 17 361 109 392 361 111 111 111 111 110 954 703 298 595 485 938 ÷ 2 = 8 680 554 696 180 555 555 555 555 555 477 351 649 297 742 969 + 0;
  • 8 680 554 696 180 555 555 555 555 555 477 351 649 297 742 969 ÷ 2 = 4 340 277 348 090 277 777 777 777 777 738 675 824 648 871 484 + 1;
  • 4 340 277 348 090 277 777 777 777 777 738 675 824 648 871 484 ÷ 2 = 2 170 138 674 045 138 888 888 888 888 869 337 912 324 435 742 + 0;
  • 2 170 138 674 045 138 888 888 888 888 869 337 912 324 435 742 ÷ 2 = 1 085 069 337 022 569 444 444 444 444 434 668 956 162 217 871 + 0;
  • 1 085 069 337 022 569 444 444 444 444 434 668 956 162 217 871 ÷ 2 = 542 534 668 511 284 722 222 222 222 217 334 478 081 108 935 + 1;
  • 542 534 668 511 284 722 222 222 222 217 334 478 081 108 935 ÷ 2 = 271 267 334 255 642 361 111 111 111 108 667 239 040 554 467 + 1;
  • 271 267 334 255 642 361 111 111 111 108 667 239 040 554 467 ÷ 2 = 135 633 667 127 821 180 555 555 555 554 333 619 520 277 233 + 1;
  • 135 633 667 127 821 180 555 555 555 554 333 619 520 277 233 ÷ 2 = 67 816 833 563 910 590 277 777 777 777 166 809 760 138 616 + 1;
  • 67 816 833 563 910 590 277 777 777 777 166 809 760 138 616 ÷ 2 = 33 908 416 781 955 295 138 888 888 888 583 404 880 069 308 + 0;
  • 33 908 416 781 955 295 138 888 888 888 583 404 880 069 308 ÷ 2 = 16 954 208 390 977 647 569 444 444 444 291 702 440 034 654 + 0;
  • 16 954 208 390 977 647 569 444 444 444 291 702 440 034 654 ÷ 2 = 8 477 104 195 488 823 784 722 222 222 145 851 220 017 327 + 0;
  • 8 477 104 195 488 823 784 722 222 222 145 851 220 017 327 ÷ 2 = 4 238 552 097 744 411 892 361 111 111 072 925 610 008 663 + 1;
  • 4 238 552 097 744 411 892 361 111 111 072 925 610 008 663 ÷ 2 = 2 119 276 048 872 205 946 180 555 555 536 462 805 004 331 + 1;
  • 2 119 276 048 872 205 946 180 555 555 536 462 805 004 331 ÷ 2 = 1 059 638 024 436 102 973 090 277 777 768 231 402 502 165 + 1;
  • 1 059 638 024 436 102 973 090 277 777 768 231 402 502 165 ÷ 2 = 529 819 012 218 051 486 545 138 888 884 115 701 251 082 + 1;
  • 529 819 012 218 051 486 545 138 888 884 115 701 251 082 ÷ 2 = 264 909 506 109 025 743 272 569 444 442 057 850 625 541 + 0;
  • 264 909 506 109 025 743 272 569 444 442 057 850 625 541 ÷ 2 = 132 454 753 054 512 871 636 284 722 221 028 925 312 770 + 1;
  • 132 454 753 054 512 871 636 284 722 221 028 925 312 770 ÷ 2 = 66 227 376 527 256 435 818 142 361 110 514 462 656 385 + 0;
  • 66 227 376 527 256 435 818 142 361 110 514 462 656 385 ÷ 2 = 33 113 688 263 628 217 909 071 180 555 257 231 328 192 + 1;
  • 33 113 688 263 628 217 909 071 180 555 257 231 328 192 ÷ 2 = 16 556 844 131 814 108 954 535 590 277 628 615 664 096 + 0;
  • 16 556 844 131 814 108 954 535 590 277 628 615 664 096 ÷ 2 = 8 278 422 065 907 054 477 267 795 138 814 307 832 048 + 0;
  • 8 278 422 065 907 054 477 267 795 138 814 307 832 048 ÷ 2 = 4 139 211 032 953 527 238 633 897 569 407 153 916 024 + 0;
  • 4 139 211 032 953 527 238 633 897 569 407 153 916 024 ÷ 2 = 2 069 605 516 476 763 619 316 948 784 703 576 958 012 + 0;
  • 2 069 605 516 476 763 619 316 948 784 703 576 958 012 ÷ 2 = 1 034 802 758 238 381 809 658 474 392 351 788 479 006 + 0;
  • 1 034 802 758 238 381 809 658 474 392 351 788 479 006 ÷ 2 = 517 401 379 119 190 904 829 237 196 175 894 239 503 + 0;
  • 517 401 379 119 190 904 829 237 196 175 894 239 503 ÷ 2 = 258 700 689 559 595 452 414 618 598 087 947 119 751 + 1;
  • 258 700 689 559 595 452 414 618 598 087 947 119 751 ÷ 2 = 129 350 344 779 797 726 207 309 299 043 973 559 875 + 1;
  • 129 350 344 779 797 726 207 309 299 043 973 559 875 ÷ 2 = 64 675 172 389 898 863 103 654 649 521 986 779 937 + 1;
  • 64 675 172 389 898 863 103 654 649 521 986 779 937 ÷ 2 = 32 337 586 194 949 431 551 827 324 760 993 389 968 + 1;
  • 32 337 586 194 949 431 551 827 324 760 993 389 968 ÷ 2 = 16 168 793 097 474 715 775 913 662 380 496 694 984 + 0;
  • 16 168 793 097 474 715 775 913 662 380 496 694 984 ÷ 2 = 8 084 396 548 737 357 887 956 831 190 248 347 492 + 0;
  • 8 084 396 548 737 357 887 956 831 190 248 347 492 ÷ 2 = 4 042 198 274 368 678 943 978 415 595 124 173 746 + 0;
  • 4 042 198 274 368 678 943 978 415 595 124 173 746 ÷ 2 = 2 021 099 137 184 339 471 989 207 797 562 086 873 + 0;
  • 2 021 099 137 184 339 471 989 207 797 562 086 873 ÷ 2 = 1 010 549 568 592 169 735 994 603 898 781 043 436 + 1;
  • 1 010 549 568 592 169 735 994 603 898 781 043 436 ÷ 2 = 505 274 784 296 084 867 997 301 949 390 521 718 + 0;
  • 505 274 784 296 084 867 997 301 949 390 521 718 ÷ 2 = 252 637 392 148 042 433 998 650 974 695 260 859 + 0;
  • 252 637 392 148 042 433 998 650 974 695 260 859 ÷ 2 = 126 318 696 074 021 216 999 325 487 347 630 429 + 1;
  • 126 318 696 074 021 216 999 325 487 347 630 429 ÷ 2 = 63 159 348 037 010 608 499 662 743 673 815 214 + 1;
  • 63 159 348 037 010 608 499 662 743 673 815 214 ÷ 2 = 31 579 674 018 505 304 249 831 371 836 907 607 + 0;
  • 31 579 674 018 505 304 249 831 371 836 907 607 ÷ 2 = 15 789 837 009 252 652 124 915 685 918 453 803 + 1;
  • 15 789 837 009 252 652 124 915 685 918 453 803 ÷ 2 = 7 894 918 504 626 326 062 457 842 959 226 901 + 1;
  • 7 894 918 504 626 326 062 457 842 959 226 901 ÷ 2 = 3 947 459 252 313 163 031 228 921 479 613 450 + 1;
  • 3 947 459 252 313 163 031 228 921 479 613 450 ÷ 2 = 1 973 729 626 156 581 515 614 460 739 806 725 + 0;
  • 1 973 729 626 156 581 515 614 460 739 806 725 ÷ 2 = 986 864 813 078 290 757 807 230 369 903 362 + 1;
  • 986 864 813 078 290 757 807 230 369 903 362 ÷ 2 = 493 432 406 539 145 378 903 615 184 951 681 + 0;
  • 493 432 406 539 145 378 903 615 184 951 681 ÷ 2 = 246 716 203 269 572 689 451 807 592 475 840 + 1;
  • 246 716 203 269 572 689 451 807 592 475 840 ÷ 2 = 123 358 101 634 786 344 725 903 796 237 920 + 0;
  • 123 358 101 634 786 344 725 903 796 237 920 ÷ 2 = 61 679 050 817 393 172 362 951 898 118 960 + 0;
  • 61 679 050 817 393 172 362 951 898 118 960 ÷ 2 = 30 839 525 408 696 586 181 475 949 059 480 + 0;
  • 30 839 525 408 696 586 181 475 949 059 480 ÷ 2 = 15 419 762 704 348 293 090 737 974 529 740 + 0;
  • 15 419 762 704 348 293 090 737 974 529 740 ÷ 2 = 7 709 881 352 174 146 545 368 987 264 870 + 0;
  • 7 709 881 352 174 146 545 368 987 264 870 ÷ 2 = 3 854 940 676 087 073 272 684 493 632 435 + 0;
  • 3 854 940 676 087 073 272 684 493 632 435 ÷ 2 = 1 927 470 338 043 536 636 342 246 816 217 + 1;
  • 1 927 470 338 043 536 636 342 246 816 217 ÷ 2 = 963 735 169 021 768 318 171 123 408 108 + 1;
  • 963 735 169 021 768 318 171 123 408 108 ÷ 2 = 481 867 584 510 884 159 085 561 704 054 + 0;
  • 481 867 584 510 884 159 085 561 704 054 ÷ 2 = 240 933 792 255 442 079 542 780 852 027 + 0;
  • 240 933 792 255 442 079 542 780 852 027 ÷ 2 = 120 466 896 127 721 039 771 390 426 013 + 1;
  • 120 466 896 127 721 039 771 390 426 013 ÷ 2 = 60 233 448 063 860 519 885 695 213 006 + 1;
  • 60 233 448 063 860 519 885 695 213 006 ÷ 2 = 30 116 724 031 930 259 942 847 606 503 + 0;
  • 30 116 724 031 930 259 942 847 606 503 ÷ 2 = 15 058 362 015 965 129 971 423 803 251 + 1;
  • 15 058 362 015 965 129 971 423 803 251 ÷ 2 = 7 529 181 007 982 564 985 711 901 625 + 1;
  • 7 529 181 007 982 564 985 711 901 625 ÷ 2 = 3 764 590 503 991 282 492 855 950 812 + 1;
  • 3 764 590 503 991 282 492 855 950 812 ÷ 2 = 1 882 295 251 995 641 246 427 975 406 + 0;
  • 1 882 295 251 995 641 246 427 975 406 ÷ 2 = 941 147 625 997 820 623 213 987 703 + 0;
  • 941 147 625 997 820 623 213 987 703 ÷ 2 = 470 573 812 998 910 311 606 993 851 + 1;
  • 470 573 812 998 910 311 606 993 851 ÷ 2 = 235 286 906 499 455 155 803 496 925 + 1;
  • 235 286 906 499 455 155 803 496 925 ÷ 2 = 117 643 453 249 727 577 901 748 462 + 1;
  • 117 643 453 249 727 577 901 748 462 ÷ 2 = 58 821 726 624 863 788 950 874 231 + 0;
  • 58 821 726 624 863 788 950 874 231 ÷ 2 = 29 410 863 312 431 894 475 437 115 + 1;
  • 29 410 863 312 431 894 475 437 115 ÷ 2 = 14 705 431 656 215 947 237 718 557 + 1;
  • 14 705 431 656 215 947 237 718 557 ÷ 2 = 7 352 715 828 107 973 618 859 278 + 1;
  • 7 352 715 828 107 973 618 859 278 ÷ 2 = 3 676 357 914 053 986 809 429 639 + 0;
  • 3 676 357 914 053 986 809 429 639 ÷ 2 = 1 838 178 957 026 993 404 714 819 + 1;
  • 1 838 178 957 026 993 404 714 819 ÷ 2 = 919 089 478 513 496 702 357 409 + 1;
  • 919 089 478 513 496 702 357 409 ÷ 2 = 459 544 739 256 748 351 178 704 + 1;
  • 459 544 739 256 748 351 178 704 ÷ 2 = 229 772 369 628 374 175 589 352 + 0;
  • 229 772 369 628 374 175 589 352 ÷ 2 = 114 886 184 814 187 087 794 676 + 0;
  • 114 886 184 814 187 087 794 676 ÷ 2 = 57 443 092 407 093 543 897 338 + 0;
  • 57 443 092 407 093 543 897 338 ÷ 2 = 28 721 546 203 546 771 948 669 + 0;
  • 28 721 546 203 546 771 948 669 ÷ 2 = 14 360 773 101 773 385 974 334 + 1;
  • 14 360 773 101 773 385 974 334 ÷ 2 = 7 180 386 550 886 692 987 167 + 0;
  • 7 180 386 550 886 692 987 167 ÷ 2 = 3 590 193 275 443 346 493 583 + 1;
  • 3 590 193 275 443 346 493 583 ÷ 2 = 1 795 096 637 721 673 246 791 + 1;
  • 1 795 096 637 721 673 246 791 ÷ 2 = 897 548 318 860 836 623 395 + 1;
  • 897 548 318 860 836 623 395 ÷ 2 = 448 774 159 430 418 311 697 + 1;
  • 448 774 159 430 418 311 697 ÷ 2 = 224 387 079 715 209 155 848 + 1;
  • 224 387 079 715 209 155 848 ÷ 2 = 112 193 539 857 604 577 924 + 0;
  • 112 193 539 857 604 577 924 ÷ 2 = 56 096 769 928 802 288 962 + 0;
  • 56 096 769 928 802 288 962 ÷ 2 = 28 048 384 964 401 144 481 + 0;
  • 28 048 384 964 401 144 481 ÷ 2 = 14 024 192 482 200 572 240 + 1;
  • 14 024 192 482 200 572 240 ÷ 2 = 7 012 096 241 100 286 120 + 0;
  • 7 012 096 241 100 286 120 ÷ 2 = 3 506 048 120 550 143 060 + 0;
  • 3 506 048 120 550 143 060 ÷ 2 = 1 753 024 060 275 071 530 + 0;
  • 1 753 024 060 275 071 530 ÷ 2 = 876 512 030 137 535 765 + 0;
  • 876 512 030 137 535 765 ÷ 2 = 438 256 015 068 767 882 + 1;
  • 438 256 015 068 767 882 ÷ 2 = 219 128 007 534 383 941 + 0;
  • 219 128 007 534 383 941 ÷ 2 = 109 564 003 767 191 970 + 1;
  • 109 564 003 767 191 970 ÷ 2 = 54 782 001 883 595 985 + 0;
  • 54 782 001 883 595 985 ÷ 2 = 27 391 000 941 797 992 + 1;
  • 27 391 000 941 797 992 ÷ 2 = 13 695 500 470 898 996 + 0;
  • 13 695 500 470 898 996 ÷ 2 = 6 847 750 235 449 498 + 0;
  • 6 847 750 235 449 498 ÷ 2 = 3 423 875 117 724 749 + 0;
  • 3 423 875 117 724 749 ÷ 2 = 1 711 937 558 862 374 + 1;
  • 1 711 937 558 862 374 ÷ 2 = 855 968 779 431 187 + 0;
  • 855 968 779 431 187 ÷ 2 = 427 984 389 715 593 + 1;
  • 427 984 389 715 593 ÷ 2 = 213 992 194 857 796 + 1;
  • 213 992 194 857 796 ÷ 2 = 106 996 097 428 898 + 0;
  • 106 996 097 428 898 ÷ 2 = 53 498 048 714 449 + 0;
  • 53 498 048 714 449 ÷ 2 = 26 749 024 357 224 + 1;
  • 26 749 024 357 224 ÷ 2 = 13 374 512 178 612 + 0;
  • 13 374 512 178 612 ÷ 2 = 6 687 256 089 306 + 0;
  • 6 687 256 089 306 ÷ 2 = 3 343 628 044 653 + 0;
  • 3 343 628 044 653 ÷ 2 = 1 671 814 022 326 + 1;
  • 1 671 814 022 326 ÷ 2 = 835 907 011 163 + 0;
  • 835 907 011 163 ÷ 2 = 417 953 505 581 + 1;
  • 417 953 505 581 ÷ 2 = 208 976 752 790 + 1;
  • 208 976 752 790 ÷ 2 = 104 488 376 395 + 0;
  • 104 488 376 395 ÷ 2 = 52 244 188 197 + 1;
  • 52 244 188 197 ÷ 2 = 26 122 094 098 + 1;
  • 26 122 094 098 ÷ 2 = 13 061 047 049 + 0;
  • 13 061 047 049 ÷ 2 = 6 530 523 524 + 1;
  • 6 530 523 524 ÷ 2 = 3 265 261 762 + 0;
  • 3 265 261 762 ÷ 2 = 1 632 630 881 + 0;
  • 1 632 630 881 ÷ 2 = 816 315 440 + 1;
  • 816 315 440 ÷ 2 = 408 157 720 + 0;
  • 408 157 720 ÷ 2 = 204 078 860 + 0;
  • 204 078 860 ÷ 2 = 102 039 430 + 0;
  • 102 039 430 ÷ 2 = 51 019 715 + 0;
  • 51 019 715 ÷ 2 = 25 509 857 + 1;
  • 25 509 857 ÷ 2 = 12 754 928 + 1;
  • 12 754 928 ÷ 2 = 6 377 464 + 0;
  • 6 377 464 ÷ 2 = 3 188 732 + 0;
  • 3 188 732 ÷ 2 = 1 594 366 + 0;
  • 1 594 366 ÷ 2 = 797 183 + 0;
  • 797 183 ÷ 2 = 398 591 + 1;
  • 398 591 ÷ 2 = 199 295 + 1;
  • 199 295 ÷ 2 = 99 647 + 1;
  • 99 647 ÷ 2 = 49 823 + 1;
  • 49 823 ÷ 2 = 24 911 + 1;
  • 24 911 ÷ 2 = 12 455 + 1;
  • 12 455 ÷ 2 = 6 227 + 1;
  • 6 227 ÷ 2 = 3 113 + 1;
  • 3 113 ÷ 2 = 1 556 + 1;
  • 1 556 ÷ 2 = 778 + 0;
  • 778 ÷ 2 = 389 + 0;
  • 389 ÷ 2 = 194 + 1;
  • 194 ÷ 2 = 97 + 0;
  • 97 ÷ 2 = 48 + 1;
  • 48 ÷ 2 = 24 + 0;
  • 24 ÷ 2 = 12 + 0;
  • 12 ÷ 2 = 6 + 0;
  • 6 ÷ 2 = 3 + 0;
  • 3 ÷ 2 = 1 + 1;
  • 1 ÷ 2 = 0 + 1;

2. Construct the base 2 representation of the positive number.

Take all the remainders starting from the bottom of the list constructed above.

1 111 111 001 111 111 111 111 111 111 101 101 011 110 111 100 083(10) =


1100 0010 1001 1111 1111 0000 1100 0010 0101 1011 0100 0100 1101 0001 0101 0000 1000 1111 1010 0001 1101 1101 1100 1110 1100 1100 0000 1010 1110 1100 1000 0111 1000 0001 0101 1110 0011 1100 1011 0011(2)


3. Normalize the binary representation of the number.

Shift the decimal mark 159 positions to the left, so that only one non zero digit remains to the left of it:


1 111 111 001 111 111 111 111 111 111 101 101 011 110 111 100 083(10) =


1100 0010 1001 1111 1111 0000 1100 0010 0101 1011 0100 0100 1101 0001 0101 0000 1000 1111 1010 0001 1101 1101 1100 1110 1100 1100 0000 1010 1110 1100 1000 0111 1000 0001 0101 1110 0011 1100 1011 0011(2) =


1100 0010 1001 1111 1111 0000 1100 0010 0101 1011 0100 0100 1101 0001 0101 0000 1000 1111 1010 0001 1101 1101 1100 1110 1100 1100 0000 1010 1110 1100 1000 0111 1000 0001 0101 1110 0011 1100 1011 0011(2) × 20 =


1.1000 0101 0011 1111 1110 0001 1000 0100 1011 0110 1000 1001 1010 0010 1010 0001 0001 1111 0100 0011 1011 1011 1001 1101 1001 1000 0001 0101 1101 1001 0000 1111 0000 0010 1011 1100 0111 1001 0110 011(2) × 2159


4. 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): 159


Mantissa (not normalized):
1.1000 0101 0011 1111 1110 0001 1000 0100 1011 0110 1000 1001 1010 0010 1010 0001 0001 1111 0100 0011 1011 1011 1001 1101 1001 1000 0001 0101 1101 1001 0000 1111 0000 0010 1011 1100 0111 1001 0110 011


5. Adjust the exponent.

Use the 11 bit excess/bias notation:


Exponent (adjusted) =


Exponent (unadjusted) + 2(11-1) - 1 =


159 + 2(11-1) - 1 =


(159 + 1 023)(10) =


1 182(10)


6. 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 182 ÷ 2 = 591 + 0;
  • 591 ÷ 2 = 295 + 1;
  • 295 ÷ 2 = 147 + 1;
  • 147 ÷ 2 = 73 + 1;
  • 73 ÷ 2 = 36 + 1;
  • 36 ÷ 2 = 18 + 0;
  • 18 ÷ 2 = 9 + 0;
  • 9 ÷ 2 = 4 + 1;
  • 4 ÷ 2 = 2 + 0;
  • 2 ÷ 2 = 1 + 0;
  • 1 ÷ 2 = 0 + 1;

7. Construct the base 2 representation of the adjusted exponent.

Take all the remainders starting from the bottom of the list constructed above.


Exponent (adjusted) =


1182(10) =


100 1001 1110(2)


8. 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. 1000 0101 0011 1111 1110 0001 1000 0100 1011 0110 1000 1001 1010 001 0101 0000 1000 1111 1010 0001 1101 1101 1100 1110 1100 1100 0000 1010 1110 1100 1000 0111 1000 0001 0101 1110 0011 1100 1011 0011 =


1000 0101 0011 1111 1110 0001 1000 0100 1011 0110 1000 1001 1010


9. 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 1001 1110


Mantissa (52 bits) =
1000 0101 0011 1111 1110 0001 1000 0100 1011 0110 1000 1001 1010


Decimal number 1 111 111 001 111 111 111 111 111 111 101 101 011 110 111 100 083 converted to 64 bit double precision IEEE 754 binary floating point representation:

0 - 100 1001 1110 - 1000 0101 0011 1111 1110 0001 1000 0100 1011 0110 1000 1001 1010


How to convert numbers from the decimal system (base ten) to 64 bit double precision IEEE 754 binary floating point standard

Follow the steps below to convert a base 10 decimal number to 64 bit double precision IEEE 754 binary floating point:

  • 1. If the number to be converted is negative, start with its the positive version.
  • 2. First convert the integer part. Divide repeatedly by 2 the positive representation of the integer number that is to be converted to binary, until we get a quotient that is equal to zero, keeping track of each remainder.
  • 3. Construct the base 2 representation of the positive integer part of the number, by taking all the remainders from the previous operations, starting from the bottom of the list constructed above. Thus, the last remainder of the divisions becomes the first symbol (the leftmost) of the base two number, while the first remainder becomes the last symbol (the rightmost).
  • 4. Then convert the fractional part. Multiply the number repeatedly by 2, until we get a fractional part that is equal to zero, keeping track of each integer part of the results.
  • 5. Construct the base 2 representation of the fractional part of the number, by taking all the integer parts of the multiplying operations, starting from the top of the list constructed above (they should appear in the binary representation, from left to right, in the order they have been calculated).
  • 6. Normalize the binary representation of the number, shifting the decimal mark (the decimal point) "n" positions either to the left, or to the right, so that only one non zero digit remains to the left of the decimal mark.
  • 7. Adjust the exponent in 11 bit excess/bias notation and then convert it from decimal (base 10) to 11 bit binary, by using the same technique of repeatedly dividing by 2, as shown above:
    Exponent (adjusted) = Exponent (unadjusted) + 2(11-1) - 1
  • 8. Normalize mantissa, remove the leading (leftmost) bit, since it's allways '1' (and the decimal mark, if the case) and adjust its length to 52 bits, either by removing the excess bits from the right (losing precision...) or by adding extra bits set on '0' to the right.
  • 9. Sign (it takes 1 bit) is either 1 for a negative or 0 for a positive number.

Example: convert the negative number -31.640 215 from the decimal system (base ten) to 64 bit double precision IEEE 754 binary floating point:

  • 1. Start with the positive version of the number:

    |-31.640 215| = 31.640 215

  • 2. First convert the integer part, 31. Divide it repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:
    • division = quotient + remainder;
    • 31 ÷ 2 = 15 + 1;
    • 15 ÷ 2 = 7 + 1;
    • 7 ÷ 2 = 3 + 1;
    • 3 ÷ 2 = 1 + 1;
    • 1 ÷ 2 = 0 + 1;
    • We have encountered a quotient that is ZERO => FULL STOP
  • 3. Construct the base 2 representation of the integer part of the number by taking all the remainders of the previous dividing operations, starting from the bottom of the list constructed above:

    31(10) = 1 1111(2)

  • 4. Then, convert the fractional part, 0.640 215. Multiply repeatedly by 2, keeping track of each integer part of the results, until we get a fractional part that is equal to zero:
    • #) multiplying = integer + fractional part;
    • 1) 0.640 215 × 2 = 1 + 0.280 43;
    • 2) 0.280 43 × 2 = 0 + 0.560 86;
    • 3) 0.560 86 × 2 = 1 + 0.121 72;
    • 4) 0.121 72 × 2 = 0 + 0.243 44;
    • 5) 0.243 44 × 2 = 0 + 0.486 88;
    • 6) 0.486 88 × 2 = 0 + 0.973 76;
    • 7) 0.973 76 × 2 = 1 + 0.947 52;
    • 8) 0.947 52 × 2 = 1 + 0.895 04;
    • 9) 0.895 04 × 2 = 1 + 0.790 08;
    • 10) 0.790 08 × 2 = 1 + 0.580 16;
    • 11) 0.580 16 × 2 = 1 + 0.160 32;
    • 12) 0.160 32 × 2 = 0 + 0.320 64;
    • 13) 0.320 64 × 2 = 0 + 0.641 28;
    • 14) 0.641 28 × 2 = 1 + 0.282 56;
    • 15) 0.282 56 × 2 = 0 + 0.565 12;
    • 16) 0.565 12 × 2 = 1 + 0.130 24;
    • 17) 0.130 24 × 2 = 0 + 0.260 48;
    • 18) 0.260 48 × 2 = 0 + 0.520 96;
    • 19) 0.520 96 × 2 = 1 + 0.041 92;
    • 20) 0.041 92 × 2 = 0 + 0.083 84;
    • 21) 0.083 84 × 2 = 0 + 0.167 68;
    • 22) 0.167 68 × 2 = 0 + 0.335 36;
    • 23) 0.335 36 × 2 = 0 + 0.670 72;
    • 24) 0.670 72 × 2 = 1 + 0.341 44;
    • 25) 0.341 44 × 2 = 0 + 0.682 88;
    • 26) 0.682 88 × 2 = 1 + 0.365 76;
    • 27) 0.365 76 × 2 = 0 + 0.731 52;
    • 28) 0.731 52 × 2 = 1 + 0.463 04;
    • 29) 0.463 04 × 2 = 0 + 0.926 08;
    • 30) 0.926 08 × 2 = 1 + 0.852 16;
    • 31) 0.852 16 × 2 = 1 + 0.704 32;
    • 32) 0.704 32 × 2 = 1 + 0.408 64;
    • 33) 0.408 64 × 2 = 0 + 0.817 28;
    • 34) 0.817 28 × 2 = 1 + 0.634 56;
    • 35) 0.634 56 × 2 = 1 + 0.269 12;
    • 36) 0.269 12 × 2 = 0 + 0.538 24;
    • 37) 0.538 24 × 2 = 1 + 0.076 48;
    • 38) 0.076 48 × 2 = 0 + 0.152 96;
    • 39) 0.152 96 × 2 = 0 + 0.305 92;
    • 40) 0.305 92 × 2 = 0 + 0.611 84;
    • 41) 0.611 84 × 2 = 1 + 0.223 68;
    • 42) 0.223 68 × 2 = 0 + 0.447 36;
    • 43) 0.447 36 × 2 = 0 + 0.894 72;
    • 44) 0.894 72 × 2 = 1 + 0.789 44;
    • 45) 0.789 44 × 2 = 1 + 0.578 88;
    • 46) 0.578 88 × 2 = 1 + 0.157 76;
    • 47) 0.157 76 × 2 = 0 + 0.315 52;
    • 48) 0.315 52 × 2 = 0 + 0.631 04;
    • 49) 0.631 04 × 2 = 1 + 0.262 08;
    • 50) 0.262 08 × 2 = 0 + 0.524 16;
    • 51) 0.524 16 × 2 = 1 + 0.048 32;
    • 52) 0.048 32 × 2 = 0 + 0.096 64;
    • 53) 0.096 64 × 2 = 0 + 0.193 28;
    • We didn't get any fractional part that was equal to zero. But we had enough iterations (over Mantissa limit = 52) and at least one integer part that was different from zero => FULL STOP (losing precision...).
  • 5. Construct the base 2 representation of the fractional part of the number, by taking all the integer parts of the previous multiplying operations, starting from the top of the constructed list above:

    0.640 215(10) = 0.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2)

  • 6. Summarizing - the positive number before normalization:

    31.640 215(10) = 1 1111.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2)

  • 7. Normalize the binary representation of the number, shifting the decimal mark 4 positions to the left so that only one non-zero digit stays to the left of the decimal mark:

    31.640 215(10) =
    1 1111.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2) =
    1 1111.1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2) × 20 =
    1.1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0(2) × 24

  • 8. 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: 1 (a negative number)

    Exponent (unadjusted): 4

    Mantissa (not-normalized): 1.1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0

  • 9. Adjust the exponent in 11 bit excess/bias notation and then convert it from decimal (base 10) to 11 bit binary (base 2), by using the same technique of repeatedly dividing it by 2, as shown above:

    Exponent (adjusted) = Exponent (unadjusted) + 2(11-1) - 1 = (4 + 1023)(10) = 1027(10) =
    100 0000 0011(2)

  • 10. Normalize mantissa, remove the leading (leftmost) bit, since it's allways '1' (and the decimal sign) and adjust its length to 52 bits, by removing the excess bits, from the right (losing precision...):

    Mantissa (not-normalized): 1.1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100 1010 0

    Mantissa (normalized): 1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100

  • Conclusion:

    Sign (1 bit) = 1 (a negative number)

    Exponent (8 bits) = 100 0000 0011

    Mantissa (52 bits) = 1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100

  • Number -31.640 215, converted from decimal system (base 10) to 64 bit double precision IEEE 754 binary floating point =
    1 - 100 0000 0011 - 1111 1010 0011 1110 0101 0010 0001 0101 0111 0110 1000 1001 1100