-0.000 000 000 000 000 002 335 153 506 863 212 Converted to 32 Bit Single Precision IEEE 754 Binary Floating Point Representation Standard
Convert decimal -0.000 000 000 000 000 002 335 153 506 863 212(10) to 32 bit single precision IEEE 754 binary floating point representation standard (1 bit for sign, 8 bits for exponent, 23 bits for mantissa)
What are the steps to convert decimal number
-0.000 000 000 000 000 002 335 153 506 863 212(10) to 32 bit single precision IEEE 754 binary floating point representation (1 bit for sign, 8 bits for exponent, 23 bits for mantissa)
1. Start with the positive version of the number:
|-0.000 000 000 000 000 002 335 153 506 863 212| = 0.000 000 000 000 000 002 335 153 506 863 212
2. 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;
3. 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)
4. Convert to binary (base 2) the fractional part: 0.000 000 000 000 000 002 335 153 506 863 212.
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.000 000 000 000 000 002 335 153 506 863 212 × 2 = 0 + 0.000 000 000 000 000 004 670 307 013 726 424;
- 2) 0.000 000 000 000 000 004 670 307 013 726 424 × 2 = 0 + 0.000 000 000 000 000 009 340 614 027 452 848;
- 3) 0.000 000 000 000 000 009 340 614 027 452 848 × 2 = 0 + 0.000 000 000 000 000 018 681 228 054 905 696;
- 4) 0.000 000 000 000 000 018 681 228 054 905 696 × 2 = 0 + 0.000 000 000 000 000 037 362 456 109 811 392;
- 5) 0.000 000 000 000 000 037 362 456 109 811 392 × 2 = 0 + 0.000 000 000 000 000 074 724 912 219 622 784;
- 6) 0.000 000 000 000 000 074 724 912 219 622 784 × 2 = 0 + 0.000 000 000 000 000 149 449 824 439 245 568;
- 7) 0.000 000 000 000 000 149 449 824 439 245 568 × 2 = 0 + 0.000 000 000 000 000 298 899 648 878 491 136;
- 8) 0.000 000 000 000 000 298 899 648 878 491 136 × 2 = 0 + 0.000 000 000 000 000 597 799 297 756 982 272;
- 9) 0.000 000 000 000 000 597 799 297 756 982 272 × 2 = 0 + 0.000 000 000 000 001 195 598 595 513 964 544;
- 10) 0.000 000 000 000 001 195 598 595 513 964 544 × 2 = 0 + 0.000 000 000 000 002 391 197 191 027 929 088;
- 11) 0.000 000 000 000 002 391 197 191 027 929 088 × 2 = 0 + 0.000 000 000 000 004 782 394 382 055 858 176;
- 12) 0.000 000 000 000 004 782 394 382 055 858 176 × 2 = 0 + 0.000 000 000 000 009 564 788 764 111 716 352;
- 13) 0.000 000 000 000 009 564 788 764 111 716 352 × 2 = 0 + 0.000 000 000 000 019 129 577 528 223 432 704;
- 14) 0.000 000 000 000 019 129 577 528 223 432 704 × 2 = 0 + 0.000 000 000 000 038 259 155 056 446 865 408;
- 15) 0.000 000 000 000 038 259 155 056 446 865 408 × 2 = 0 + 0.000 000 000 000 076 518 310 112 893 730 816;
- 16) 0.000 000 000 000 076 518 310 112 893 730 816 × 2 = 0 + 0.000 000 000 000 153 036 620 225 787 461 632;
- 17) 0.000 000 000 000 153 036 620 225 787 461 632 × 2 = 0 + 0.000 000 000 000 306 073 240 451 574 923 264;
- 18) 0.000 000 000 000 306 073 240 451 574 923 264 × 2 = 0 + 0.000 000 000 000 612 146 480 903 149 846 528;
- 19) 0.000 000 000 000 612 146 480 903 149 846 528 × 2 = 0 + 0.000 000 000 001 224 292 961 806 299 693 056;
- 20) 0.000 000 000 001 224 292 961 806 299 693 056 × 2 = 0 + 0.000 000 000 002 448 585 923 612 599 386 112;
- 21) 0.000 000 000 002 448 585 923 612 599 386 112 × 2 = 0 + 0.000 000 000 004 897 171 847 225 198 772 224;
- 22) 0.000 000 000 004 897 171 847 225 198 772 224 × 2 = 0 + 0.000 000 000 009 794 343 694 450 397 544 448;
- 23) 0.000 000 000 009 794 343 694 450 397 544 448 × 2 = 0 + 0.000 000 000 019 588 687 388 900 795 088 896;
- 24) 0.000 000 000 019 588 687 388 900 795 088 896 × 2 = 0 + 0.000 000 000 039 177 374 777 801 590 177 792;
- 25) 0.000 000 000 039 177 374 777 801 590 177 792 × 2 = 0 + 0.000 000 000 078 354 749 555 603 180 355 584;
- 26) 0.000 000 000 078 354 749 555 603 180 355 584 × 2 = 0 + 0.000 000 000 156 709 499 111 206 360 711 168;
- 27) 0.000 000 000 156 709 499 111 206 360 711 168 × 2 = 0 + 0.000 000 000 313 418 998 222 412 721 422 336;
- 28) 0.000 000 000 313 418 998 222 412 721 422 336 × 2 = 0 + 0.000 000 000 626 837 996 444 825 442 844 672;
- 29) 0.000 000 000 626 837 996 444 825 442 844 672 × 2 = 0 + 0.000 000 001 253 675 992 889 650 885 689 344;
- 30) 0.000 000 001 253 675 992 889 650 885 689 344 × 2 = 0 + 0.000 000 002 507 351 985 779 301 771 378 688;
- 31) 0.000 000 002 507 351 985 779 301 771 378 688 × 2 = 0 + 0.000 000 005 014 703 971 558 603 542 757 376;
- 32) 0.000 000 005 014 703 971 558 603 542 757 376 × 2 = 0 + 0.000 000 010 029 407 943 117 207 085 514 752;
- 33) 0.000 000 010 029 407 943 117 207 085 514 752 × 2 = 0 + 0.000 000 020 058 815 886 234 414 171 029 504;
- 34) 0.000 000 020 058 815 886 234 414 171 029 504 × 2 = 0 + 0.000 000 040 117 631 772 468 828 342 059 008;
- 35) 0.000 000 040 117 631 772 468 828 342 059 008 × 2 = 0 + 0.000 000 080 235 263 544 937 656 684 118 016;
- 36) 0.000 000 080 235 263 544 937 656 684 118 016 × 2 = 0 + 0.000 000 160 470 527 089 875 313 368 236 032;
- 37) 0.000 000 160 470 527 089 875 313 368 236 032 × 2 = 0 + 0.000 000 320 941 054 179 750 626 736 472 064;
- 38) 0.000 000 320 941 054 179 750 626 736 472 064 × 2 = 0 + 0.000 000 641 882 108 359 501 253 472 944 128;
- 39) 0.000 000 641 882 108 359 501 253 472 944 128 × 2 = 0 + 0.000 001 283 764 216 719 002 506 945 888 256;
- 40) 0.000 001 283 764 216 719 002 506 945 888 256 × 2 = 0 + 0.000 002 567 528 433 438 005 013 891 776 512;
- 41) 0.000 002 567 528 433 438 005 013 891 776 512 × 2 = 0 + 0.000 005 135 056 866 876 010 027 783 553 024;
- 42) 0.000 005 135 056 866 876 010 027 783 553 024 × 2 = 0 + 0.000 010 270 113 733 752 020 055 567 106 048;
- 43) 0.000 010 270 113 733 752 020 055 567 106 048 × 2 = 0 + 0.000 020 540 227 467 504 040 111 134 212 096;
- 44) 0.000 020 540 227 467 504 040 111 134 212 096 × 2 = 0 + 0.000 041 080 454 935 008 080 222 268 424 192;
- 45) 0.000 041 080 454 935 008 080 222 268 424 192 × 2 = 0 + 0.000 082 160 909 870 016 160 444 536 848 384;
- 46) 0.000 082 160 909 870 016 160 444 536 848 384 × 2 = 0 + 0.000 164 321 819 740 032 320 889 073 696 768;
- 47) 0.000 164 321 819 740 032 320 889 073 696 768 × 2 = 0 + 0.000 328 643 639 480 064 641 778 147 393 536;
- 48) 0.000 328 643 639 480 064 641 778 147 393 536 × 2 = 0 + 0.000 657 287 278 960 129 283 556 294 787 072;
- 49) 0.000 657 287 278 960 129 283 556 294 787 072 × 2 = 0 + 0.001 314 574 557 920 258 567 112 589 574 144;
- 50) 0.001 314 574 557 920 258 567 112 589 574 144 × 2 = 0 + 0.002 629 149 115 840 517 134 225 179 148 288;
- 51) 0.002 629 149 115 840 517 134 225 179 148 288 × 2 = 0 + 0.005 258 298 231 681 034 268 450 358 296 576;
- 52) 0.005 258 298 231 681 034 268 450 358 296 576 × 2 = 0 + 0.010 516 596 463 362 068 536 900 716 593 152;
- 53) 0.010 516 596 463 362 068 536 900 716 593 152 × 2 = 0 + 0.021 033 192 926 724 137 073 801 433 186 304;
- 54) 0.021 033 192 926 724 137 073 801 433 186 304 × 2 = 0 + 0.042 066 385 853 448 274 147 602 866 372 608;
- 55) 0.042 066 385 853 448 274 147 602 866 372 608 × 2 = 0 + 0.084 132 771 706 896 548 295 205 732 745 216;
- 56) 0.084 132 771 706 896 548 295 205 732 745 216 × 2 = 0 + 0.168 265 543 413 793 096 590 411 465 490 432;
- 57) 0.168 265 543 413 793 096 590 411 465 490 432 × 2 = 0 + 0.336 531 086 827 586 193 180 822 930 980 864;
- 58) 0.336 531 086 827 586 193 180 822 930 980 864 × 2 = 0 + 0.673 062 173 655 172 386 361 645 861 961 728;
- 59) 0.673 062 173 655 172 386 361 645 861 961 728 × 2 = 1 + 0.346 124 347 310 344 772 723 291 723 923 456;
- 60) 0.346 124 347 310 344 772 723 291 723 923 456 × 2 = 0 + 0.692 248 694 620 689 545 446 583 447 846 912;
- 61) 0.692 248 694 620 689 545 446 583 447 846 912 × 2 = 1 + 0.384 497 389 241 379 090 893 166 895 693 824;
- 62) 0.384 497 389 241 379 090 893 166 895 693 824 × 2 = 0 + 0.768 994 778 482 758 181 786 333 791 387 648;
- 63) 0.768 994 778 482 758 181 786 333 791 387 648 × 2 = 1 + 0.537 989 556 965 516 363 572 667 582 775 296;
- 64) 0.537 989 556 965 516 363 572 667 582 775 296 × 2 = 1 + 0.075 979 113 931 032 727 145 335 165 550 592;
- 65) 0.075 979 113 931 032 727 145 335 165 550 592 × 2 = 0 + 0.151 958 227 862 065 454 290 670 331 101 184;
- 66) 0.151 958 227 862 065 454 290 670 331 101 184 × 2 = 0 + 0.303 916 455 724 130 908 581 340 662 202 368;
- 67) 0.303 916 455 724 130 908 581 340 662 202 368 × 2 = 0 + 0.607 832 911 448 261 817 162 681 324 404 736;
- 68) 0.607 832 911 448 261 817 162 681 324 404 736 × 2 = 1 + 0.215 665 822 896 523 634 325 362 648 809 472;
- 69) 0.215 665 822 896 523 634 325 362 648 809 472 × 2 = 0 + 0.431 331 645 793 047 268 650 725 297 618 944;
- 70) 0.431 331 645 793 047 268 650 725 297 618 944 × 2 = 0 + 0.862 663 291 586 094 537 301 450 595 237 888;
- 71) 0.862 663 291 586 094 537 301 450 595 237 888 × 2 = 1 + 0.725 326 583 172 189 074 602 901 190 475 776;
- 72) 0.725 326 583 172 189 074 602 901 190 475 776 × 2 = 1 + 0.450 653 166 344 378 149 205 802 380 951 552;
- 73) 0.450 653 166 344 378 149 205 802 380 951 552 × 2 = 0 + 0.901 306 332 688 756 298 411 604 761 903 104;
- 74) 0.901 306 332 688 756 298 411 604 761 903 104 × 2 = 1 + 0.802 612 665 377 512 596 823 209 523 806 208;
- 75) 0.802 612 665 377 512 596 823 209 523 806 208 × 2 = 1 + 0.605 225 330 755 025 193 646 419 047 612 416;
- 76) 0.605 225 330 755 025 193 646 419 047 612 416 × 2 = 1 + 0.210 450 661 510 050 387 292 838 095 224 832;
- 77) 0.210 450 661 510 050 387 292 838 095 224 832 × 2 = 0 + 0.420 901 323 020 100 774 585 676 190 449 664;
- 78) 0.420 901 323 020 100 774 585 676 190 449 664 × 2 = 0 + 0.841 802 646 040 201 549 171 352 380 899 328;
- 79) 0.841 802 646 040 201 549 171 352 380 899 328 × 2 = 1 + 0.683 605 292 080 403 098 342 704 761 798 656;
- 80) 0.683 605 292 080 403 098 342 704 761 798 656 × 2 = 1 + 0.367 210 584 160 806 196 685 409 523 597 312;
- 81) 0.367 210 584 160 806 196 685 409 523 597 312 × 2 = 0 + 0.734 421 168 321 612 393 370 819 047 194 624;
- 82) 0.734 421 168 321 612 393 370 819 047 194 624 × 2 = 1 + 0.468 842 336 643 224 786 741 638 094 389 248;
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).
5. 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.000 000 000 000 000 002 335 153 506 863 212(10) =
0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0010 1011 0001 0011 0111 0011 01(2)
6. Positive number before normalization:
0.000 000 000 000 000 002 335 153 506 863 212(10) =
0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0010 1011 0001 0011 0111 0011 01(2)
7. Normalize the binary representation of the number.
Shift the decimal mark 59 positions to the right, so that only one non zero digit remains to the left of it:
0.000 000 000 000 000 002 335 153 506 863 212(10) =
0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0010 1011 0001 0011 0111 0011 01(2) =
0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0010 1011 0001 0011 0111 0011 01(2) × 20 =
1.0101 1000 1001 1011 1001 101(2) × 2-59
8. Up to this moment, there are the following elements that would feed into the 32 bit single precision IEEE 754 binary floating point representation:
Sign 1 (a negative number)
Exponent (unadjusted): -59
Mantissa (not normalized):
1.0101 1000 1001 1011 1001 101
9. Adjust the exponent.
Use the 8 bit excess/bias notation:
Exponent (adjusted) =
Exponent (unadjusted) + 2(8-1) - 1 =
-59 + 2(8-1) - 1 =
(-59 + 127)(10) =
68(10)
10. Convert the adjusted exponent from the decimal (base 10) to 8 bit binary.
Use the same technique of repeatedly dividing by 2:
- division = quotient + remainder;
- 68 ÷ 2 = 34 + 0;
- 34 ÷ 2 = 17 + 0;
- 17 ÷ 2 = 8 + 1;
- 8 ÷ 2 = 4 + 0;
- 4 ÷ 2 = 2 + 0;
- 2 ÷ 2 = 1 + 0;
- 1 ÷ 2 = 0 + 1;
11. Construct the base 2 representation of the adjusted exponent.
Take all the remainders starting from the bottom of the list constructed above.
Exponent (adjusted) =
68(10) =
0100 0100(2)
12. 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 23 bits, only if necessary (not the case here).
Mantissa (normalized) =
1. 010 1100 0100 1101 1100 1101 =
010 1100 0100 1101 1100 1101
13. The three elements that make up the number's 32 bit single precision IEEE 754 binary floating point representation:
Sign (1 bit) =
1 (a negative number)
Exponent (8 bits) =
0100 0100
Mantissa (23 bits) =
010 1100 0100 1101 1100 1101
Decimal number -0.000 000 000 000 000 002 335 153 506 863 212 converted to 32 bit single precision IEEE 754 binary floating point representation:
1 - 0100 0100 - 010 1100 0100 1101 1100 1101