-0.000 000 000 000 000 002 335 153 506 863 283 699 74 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 283 699 74(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 283 699 74(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 283 699 74| = 0.000 000 000 000 000 002 335 153 506 863 283 699 74
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 283 699 74.
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 283 699 74 × 2 = 0 + 0.000 000 000 000 000 004 670 307 013 726 567 399 48;
- 2) 0.000 000 000 000 000 004 670 307 013 726 567 399 48 × 2 = 0 + 0.000 000 000 000 000 009 340 614 027 453 134 798 96;
- 3) 0.000 000 000 000 000 009 340 614 027 453 134 798 96 × 2 = 0 + 0.000 000 000 000 000 018 681 228 054 906 269 597 92;
- 4) 0.000 000 000 000 000 018 681 228 054 906 269 597 92 × 2 = 0 + 0.000 000 000 000 000 037 362 456 109 812 539 195 84;
- 5) 0.000 000 000 000 000 037 362 456 109 812 539 195 84 × 2 = 0 + 0.000 000 000 000 000 074 724 912 219 625 078 391 68;
- 6) 0.000 000 000 000 000 074 724 912 219 625 078 391 68 × 2 = 0 + 0.000 000 000 000 000 149 449 824 439 250 156 783 36;
- 7) 0.000 000 000 000 000 149 449 824 439 250 156 783 36 × 2 = 0 + 0.000 000 000 000 000 298 899 648 878 500 313 566 72;
- 8) 0.000 000 000 000 000 298 899 648 878 500 313 566 72 × 2 = 0 + 0.000 000 000 000 000 597 799 297 757 000 627 133 44;
- 9) 0.000 000 000 000 000 597 799 297 757 000 627 133 44 × 2 = 0 + 0.000 000 000 000 001 195 598 595 514 001 254 266 88;
- 10) 0.000 000 000 000 001 195 598 595 514 001 254 266 88 × 2 = 0 + 0.000 000 000 000 002 391 197 191 028 002 508 533 76;
- 11) 0.000 000 000 000 002 391 197 191 028 002 508 533 76 × 2 = 0 + 0.000 000 000 000 004 782 394 382 056 005 017 067 52;
- 12) 0.000 000 000 000 004 782 394 382 056 005 017 067 52 × 2 = 0 + 0.000 000 000 000 009 564 788 764 112 010 034 135 04;
- 13) 0.000 000 000 000 009 564 788 764 112 010 034 135 04 × 2 = 0 + 0.000 000 000 000 019 129 577 528 224 020 068 270 08;
- 14) 0.000 000 000 000 019 129 577 528 224 020 068 270 08 × 2 = 0 + 0.000 000 000 000 038 259 155 056 448 040 136 540 16;
- 15) 0.000 000 000 000 038 259 155 056 448 040 136 540 16 × 2 = 0 + 0.000 000 000 000 076 518 310 112 896 080 273 080 32;
- 16) 0.000 000 000 000 076 518 310 112 896 080 273 080 32 × 2 = 0 + 0.000 000 000 000 153 036 620 225 792 160 546 160 64;
- 17) 0.000 000 000 000 153 036 620 225 792 160 546 160 64 × 2 = 0 + 0.000 000 000 000 306 073 240 451 584 321 092 321 28;
- 18) 0.000 000 000 000 306 073 240 451 584 321 092 321 28 × 2 = 0 + 0.000 000 000 000 612 146 480 903 168 642 184 642 56;
- 19) 0.000 000 000 000 612 146 480 903 168 642 184 642 56 × 2 = 0 + 0.000 000 000 001 224 292 961 806 337 284 369 285 12;
- 20) 0.000 000 000 001 224 292 961 806 337 284 369 285 12 × 2 = 0 + 0.000 000 000 002 448 585 923 612 674 568 738 570 24;
- 21) 0.000 000 000 002 448 585 923 612 674 568 738 570 24 × 2 = 0 + 0.000 000 000 004 897 171 847 225 349 137 477 140 48;
- 22) 0.000 000 000 004 897 171 847 225 349 137 477 140 48 × 2 = 0 + 0.000 000 000 009 794 343 694 450 698 274 954 280 96;
- 23) 0.000 000 000 009 794 343 694 450 698 274 954 280 96 × 2 = 0 + 0.000 000 000 019 588 687 388 901 396 549 908 561 92;
- 24) 0.000 000 000 019 588 687 388 901 396 549 908 561 92 × 2 = 0 + 0.000 000 000 039 177 374 777 802 793 099 817 123 84;
- 25) 0.000 000 000 039 177 374 777 802 793 099 817 123 84 × 2 = 0 + 0.000 000 000 078 354 749 555 605 586 199 634 247 68;
- 26) 0.000 000 000 078 354 749 555 605 586 199 634 247 68 × 2 = 0 + 0.000 000 000 156 709 499 111 211 172 399 268 495 36;
- 27) 0.000 000 000 156 709 499 111 211 172 399 268 495 36 × 2 = 0 + 0.000 000 000 313 418 998 222 422 344 798 536 990 72;
- 28) 0.000 000 000 313 418 998 222 422 344 798 536 990 72 × 2 = 0 + 0.000 000 000 626 837 996 444 844 689 597 073 981 44;
- 29) 0.000 000 000 626 837 996 444 844 689 597 073 981 44 × 2 = 0 + 0.000 000 001 253 675 992 889 689 379 194 147 962 88;
- 30) 0.000 000 001 253 675 992 889 689 379 194 147 962 88 × 2 = 0 + 0.000 000 002 507 351 985 779 378 758 388 295 925 76;
- 31) 0.000 000 002 507 351 985 779 378 758 388 295 925 76 × 2 = 0 + 0.000 000 005 014 703 971 558 757 516 776 591 851 52;
- 32) 0.000 000 005 014 703 971 558 757 516 776 591 851 52 × 2 = 0 + 0.000 000 010 029 407 943 117 515 033 553 183 703 04;
- 33) 0.000 000 010 029 407 943 117 515 033 553 183 703 04 × 2 = 0 + 0.000 000 020 058 815 886 235 030 067 106 367 406 08;
- 34) 0.000 000 020 058 815 886 235 030 067 106 367 406 08 × 2 = 0 + 0.000 000 040 117 631 772 470 060 134 212 734 812 16;
- 35) 0.000 000 040 117 631 772 470 060 134 212 734 812 16 × 2 = 0 + 0.000 000 080 235 263 544 940 120 268 425 469 624 32;
- 36) 0.000 000 080 235 263 544 940 120 268 425 469 624 32 × 2 = 0 + 0.000 000 160 470 527 089 880 240 536 850 939 248 64;
- 37) 0.000 000 160 470 527 089 880 240 536 850 939 248 64 × 2 = 0 + 0.000 000 320 941 054 179 760 481 073 701 878 497 28;
- 38) 0.000 000 320 941 054 179 760 481 073 701 878 497 28 × 2 = 0 + 0.000 000 641 882 108 359 520 962 147 403 756 994 56;
- 39) 0.000 000 641 882 108 359 520 962 147 403 756 994 56 × 2 = 0 + 0.000 001 283 764 216 719 041 924 294 807 513 989 12;
- 40) 0.000 001 283 764 216 719 041 924 294 807 513 989 12 × 2 = 0 + 0.000 002 567 528 433 438 083 848 589 615 027 978 24;
- 41) 0.000 002 567 528 433 438 083 848 589 615 027 978 24 × 2 = 0 + 0.000 005 135 056 866 876 167 697 179 230 055 956 48;
- 42) 0.000 005 135 056 866 876 167 697 179 230 055 956 48 × 2 = 0 + 0.000 010 270 113 733 752 335 394 358 460 111 912 96;
- 43) 0.000 010 270 113 733 752 335 394 358 460 111 912 96 × 2 = 0 + 0.000 020 540 227 467 504 670 788 716 920 223 825 92;
- 44) 0.000 020 540 227 467 504 670 788 716 920 223 825 92 × 2 = 0 + 0.000 041 080 454 935 009 341 577 433 840 447 651 84;
- 45) 0.000 041 080 454 935 009 341 577 433 840 447 651 84 × 2 = 0 + 0.000 082 160 909 870 018 683 154 867 680 895 303 68;
- 46) 0.000 082 160 909 870 018 683 154 867 680 895 303 68 × 2 = 0 + 0.000 164 321 819 740 037 366 309 735 361 790 607 36;
- 47) 0.000 164 321 819 740 037 366 309 735 361 790 607 36 × 2 = 0 + 0.000 328 643 639 480 074 732 619 470 723 581 214 72;
- 48) 0.000 328 643 639 480 074 732 619 470 723 581 214 72 × 2 = 0 + 0.000 657 287 278 960 149 465 238 941 447 162 429 44;
- 49) 0.000 657 287 278 960 149 465 238 941 447 162 429 44 × 2 = 0 + 0.001 314 574 557 920 298 930 477 882 894 324 858 88;
- 50) 0.001 314 574 557 920 298 930 477 882 894 324 858 88 × 2 = 0 + 0.002 629 149 115 840 597 860 955 765 788 649 717 76;
- 51) 0.002 629 149 115 840 597 860 955 765 788 649 717 76 × 2 = 0 + 0.005 258 298 231 681 195 721 911 531 577 299 435 52;
- 52) 0.005 258 298 231 681 195 721 911 531 577 299 435 52 × 2 = 0 + 0.010 516 596 463 362 391 443 823 063 154 598 871 04;
- 53) 0.010 516 596 463 362 391 443 823 063 154 598 871 04 × 2 = 0 + 0.021 033 192 926 724 782 887 646 126 309 197 742 08;
- 54) 0.021 033 192 926 724 782 887 646 126 309 197 742 08 × 2 = 0 + 0.042 066 385 853 449 565 775 292 252 618 395 484 16;
- 55) 0.042 066 385 853 449 565 775 292 252 618 395 484 16 × 2 = 0 + 0.084 132 771 706 899 131 550 584 505 236 790 968 32;
- 56) 0.084 132 771 706 899 131 550 584 505 236 790 968 32 × 2 = 0 + 0.168 265 543 413 798 263 101 169 010 473 581 936 64;
- 57) 0.168 265 543 413 798 263 101 169 010 473 581 936 64 × 2 = 0 + 0.336 531 086 827 596 526 202 338 020 947 163 873 28;
- 58) 0.336 531 086 827 596 526 202 338 020 947 163 873 28 × 2 = 0 + 0.673 062 173 655 193 052 404 676 041 894 327 746 56;
- 59) 0.673 062 173 655 193 052 404 676 041 894 327 746 56 × 2 = 1 + 0.346 124 347 310 386 104 809 352 083 788 655 493 12;
- 60) 0.346 124 347 310 386 104 809 352 083 788 655 493 12 × 2 = 0 + 0.692 248 694 620 772 209 618 704 167 577 310 986 24;
- 61) 0.692 248 694 620 772 209 618 704 167 577 310 986 24 × 2 = 1 + 0.384 497 389 241 544 419 237 408 335 154 621 972 48;
- 62) 0.384 497 389 241 544 419 237 408 335 154 621 972 48 × 2 = 0 + 0.768 994 778 483 088 838 474 816 670 309 243 944 96;
- 63) 0.768 994 778 483 088 838 474 816 670 309 243 944 96 × 2 = 1 + 0.537 989 556 966 177 676 949 633 340 618 487 889 92;
- 64) 0.537 989 556 966 177 676 949 633 340 618 487 889 92 × 2 = 1 + 0.075 979 113 932 355 353 899 266 681 236 975 779 84;
- 65) 0.075 979 113 932 355 353 899 266 681 236 975 779 84 × 2 = 0 + 0.151 958 227 864 710 707 798 533 362 473 951 559 68;
- 66) 0.151 958 227 864 710 707 798 533 362 473 951 559 68 × 2 = 0 + 0.303 916 455 729 421 415 597 066 724 947 903 119 36;
- 67) 0.303 916 455 729 421 415 597 066 724 947 903 119 36 × 2 = 0 + 0.607 832 911 458 842 831 194 133 449 895 806 238 72;
- 68) 0.607 832 911 458 842 831 194 133 449 895 806 238 72 × 2 = 1 + 0.215 665 822 917 685 662 388 266 899 791 612 477 44;
- 69) 0.215 665 822 917 685 662 388 266 899 791 612 477 44 × 2 = 0 + 0.431 331 645 835 371 324 776 533 799 583 224 954 88;
- 70) 0.431 331 645 835 371 324 776 533 799 583 224 954 88 × 2 = 0 + 0.862 663 291 670 742 649 553 067 599 166 449 909 76;
- 71) 0.862 663 291 670 742 649 553 067 599 166 449 909 76 × 2 = 1 + 0.725 326 583 341 485 299 106 135 198 332 899 819 52;
- 72) 0.725 326 583 341 485 299 106 135 198 332 899 819 52 × 2 = 1 + 0.450 653 166 682 970 598 212 270 396 665 799 639 04;
- 73) 0.450 653 166 682 970 598 212 270 396 665 799 639 04 × 2 = 0 + 0.901 306 333 365 941 196 424 540 793 331 599 278 08;
- 74) 0.901 306 333 365 941 196 424 540 793 331 599 278 08 × 2 = 1 + 0.802 612 666 731 882 392 849 081 586 663 198 556 16;
- 75) 0.802 612 666 731 882 392 849 081 586 663 198 556 16 × 2 = 1 + 0.605 225 333 463 764 785 698 163 173 326 397 112 32;
- 76) 0.605 225 333 463 764 785 698 163 173 326 397 112 32 × 2 = 1 + 0.210 450 666 927 529 571 396 326 346 652 794 224 64;
- 77) 0.210 450 666 927 529 571 396 326 346 652 794 224 64 × 2 = 0 + 0.420 901 333 855 059 142 792 652 693 305 588 449 28;
- 78) 0.420 901 333 855 059 142 792 652 693 305 588 449 28 × 2 = 0 + 0.841 802 667 710 118 285 585 305 386 611 176 898 56;
- 79) 0.841 802 667 710 118 285 585 305 386 611 176 898 56 × 2 = 1 + 0.683 605 335 420 236 571 170 610 773 222 353 797 12;
- 80) 0.683 605 335 420 236 571 170 610 773 222 353 797 12 × 2 = 1 + 0.367 210 670 840 473 142 341 221 546 444 707 594 24;
- 81) 0.367 210 670 840 473 142 341 221 546 444 707 594 24 × 2 = 0 + 0.734 421 341 680 946 284 682 443 092 889 415 188 48;
- 82) 0.734 421 341 680 946 284 682 443 092 889 415 188 48 × 2 = 1 + 0.468 842 683 361 892 569 364 886 185 778 830 376 96;
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 283 699 74(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 283 699 74(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 283 699 74(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 283 699 74 converted to 32 bit single precision IEEE 754 binary floating point representation:
1 - 0100 0100 - 010 1100 0100 1101 1100 1101