32bit IEEE 754: Decimal ↗ Single Precision Floating Point Binary: 0.000 000 000 000 000 000 000 000 000 247 398 5 Convert the Number to 32 Bit Single Precision IEEE 754 Binary Floating Point Representation Standard, From a Base 10 Decimal System Number

Number 0.000 000 000 000 000 000 000 000 000 247 398 5(10) converted and written in 32 bit single precision IEEE 754 binary floating point representation (1 bit for sign, 8 bits for exponent, 23 bits for mantissa)

1. 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;

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.


0(10) =


0(2)


3. Convert to binary (base 2) the fractional part: 0.000 000 000 000 000 000 000 000 000 247 398 5.

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 000 000 000 000 247 398 5 × 2 = 0 + 0.000 000 000 000 000 000 000 000 000 494 797;
  • 2) 0.000 000 000 000 000 000 000 000 000 494 797 × 2 = 0 + 0.000 000 000 000 000 000 000 000 000 989 594;
  • 3) 0.000 000 000 000 000 000 000 000 000 989 594 × 2 = 0 + 0.000 000 000 000 000 000 000 000 001 979 188;
  • 4) 0.000 000 000 000 000 000 000 000 001 979 188 × 2 = 0 + 0.000 000 000 000 000 000 000 000 003 958 376;
  • 5) 0.000 000 000 000 000 000 000 000 003 958 376 × 2 = 0 + 0.000 000 000 000 000 000 000 000 007 916 752;
  • 6) 0.000 000 000 000 000 000 000 000 007 916 752 × 2 = 0 + 0.000 000 000 000 000 000 000 000 015 833 504;
  • 7) 0.000 000 000 000 000 000 000 000 015 833 504 × 2 = 0 + 0.000 000 000 000 000 000 000 000 031 667 008;
  • 8) 0.000 000 000 000 000 000 000 000 031 667 008 × 2 = 0 + 0.000 000 000 000 000 000 000 000 063 334 016;
  • 9) 0.000 000 000 000 000 000 000 000 063 334 016 × 2 = 0 + 0.000 000 000 000 000 000 000 000 126 668 032;
  • 10) 0.000 000 000 000 000 000 000 000 126 668 032 × 2 = 0 + 0.000 000 000 000 000 000 000 000 253 336 064;
  • 11) 0.000 000 000 000 000 000 000 000 253 336 064 × 2 = 0 + 0.000 000 000 000 000 000 000 000 506 672 128;
  • 12) 0.000 000 000 000 000 000 000 000 506 672 128 × 2 = 0 + 0.000 000 000 000 000 000 000 001 013 344 256;
  • 13) 0.000 000 000 000 000 000 000 001 013 344 256 × 2 = 0 + 0.000 000 000 000 000 000 000 002 026 688 512;
  • 14) 0.000 000 000 000 000 000 000 002 026 688 512 × 2 = 0 + 0.000 000 000 000 000 000 000 004 053 377 024;
  • 15) 0.000 000 000 000 000 000 000 004 053 377 024 × 2 = 0 + 0.000 000 000 000 000 000 000 008 106 754 048;
  • 16) 0.000 000 000 000 000 000 000 008 106 754 048 × 2 = 0 + 0.000 000 000 000 000 000 000 016 213 508 096;
  • 17) 0.000 000 000 000 000 000 000 016 213 508 096 × 2 = 0 + 0.000 000 000 000 000 000 000 032 427 016 192;
  • 18) 0.000 000 000 000 000 000 000 032 427 016 192 × 2 = 0 + 0.000 000 000 000 000 000 000 064 854 032 384;
  • 19) 0.000 000 000 000 000 000 000 064 854 032 384 × 2 = 0 + 0.000 000 000 000 000 000 000 129 708 064 768;
  • 20) 0.000 000 000 000 000 000 000 129 708 064 768 × 2 = 0 + 0.000 000 000 000 000 000 000 259 416 129 536;
  • 21) 0.000 000 000 000 000 000 000 259 416 129 536 × 2 = 0 + 0.000 000 000 000 000 000 000 518 832 259 072;
  • 22) 0.000 000 000 000 000 000 000 518 832 259 072 × 2 = 0 + 0.000 000 000 000 000 000 001 037 664 518 144;
  • 23) 0.000 000 000 000 000 000 001 037 664 518 144 × 2 = 0 + 0.000 000 000 000 000 000 002 075 329 036 288;
  • 24) 0.000 000 000 000 000 000 002 075 329 036 288 × 2 = 0 + 0.000 000 000 000 000 000 004 150 658 072 576;
  • 25) 0.000 000 000 000 000 000 004 150 658 072 576 × 2 = 0 + 0.000 000 000 000 000 000 008 301 316 145 152;
  • 26) 0.000 000 000 000 000 000 008 301 316 145 152 × 2 = 0 + 0.000 000 000 000 000 000 016 602 632 290 304;
  • 27) 0.000 000 000 000 000 000 016 602 632 290 304 × 2 = 0 + 0.000 000 000 000 000 000 033 205 264 580 608;
  • 28) 0.000 000 000 000 000 000 033 205 264 580 608 × 2 = 0 + 0.000 000 000 000 000 000 066 410 529 161 216;
  • 29) 0.000 000 000 000 000 000 066 410 529 161 216 × 2 = 0 + 0.000 000 000 000 000 000 132 821 058 322 432;
  • 30) 0.000 000 000 000 000 000 132 821 058 322 432 × 2 = 0 + 0.000 000 000 000 000 000 265 642 116 644 864;
  • 31) 0.000 000 000 000 000 000 265 642 116 644 864 × 2 = 0 + 0.000 000 000 000 000 000 531 284 233 289 728;
  • 32) 0.000 000 000 000 000 000 531 284 233 289 728 × 2 = 0 + 0.000 000 000 000 000 001 062 568 466 579 456;
  • 33) 0.000 000 000 000 000 001 062 568 466 579 456 × 2 = 0 + 0.000 000 000 000 000 002 125 136 933 158 912;
  • 34) 0.000 000 000 000 000 002 125 136 933 158 912 × 2 = 0 + 0.000 000 000 000 000 004 250 273 866 317 824;
  • 35) 0.000 000 000 000 000 004 250 273 866 317 824 × 2 = 0 + 0.000 000 000 000 000 008 500 547 732 635 648;
  • 36) 0.000 000 000 000 000 008 500 547 732 635 648 × 2 = 0 + 0.000 000 000 000 000 017 001 095 465 271 296;
  • 37) 0.000 000 000 000 000 017 001 095 465 271 296 × 2 = 0 + 0.000 000 000 000 000 034 002 190 930 542 592;
  • 38) 0.000 000 000 000 000 034 002 190 930 542 592 × 2 = 0 + 0.000 000 000 000 000 068 004 381 861 085 184;
  • 39) 0.000 000 000 000 000 068 004 381 861 085 184 × 2 = 0 + 0.000 000 000 000 000 136 008 763 722 170 368;
  • 40) 0.000 000 000 000 000 136 008 763 722 170 368 × 2 = 0 + 0.000 000 000 000 000 272 017 527 444 340 736;
  • 41) 0.000 000 000 000 000 272 017 527 444 340 736 × 2 = 0 + 0.000 000 000 000 000 544 035 054 888 681 472;
  • 42) 0.000 000 000 000 000 544 035 054 888 681 472 × 2 = 0 + 0.000 000 000 000 001 088 070 109 777 362 944;
  • 43) 0.000 000 000 000 001 088 070 109 777 362 944 × 2 = 0 + 0.000 000 000 000 002 176 140 219 554 725 888;
  • 44) 0.000 000 000 000 002 176 140 219 554 725 888 × 2 = 0 + 0.000 000 000 000 004 352 280 439 109 451 776;
  • 45) 0.000 000 000 000 004 352 280 439 109 451 776 × 2 = 0 + 0.000 000 000 000 008 704 560 878 218 903 552;
  • 46) 0.000 000 000 000 008 704 560 878 218 903 552 × 2 = 0 + 0.000 000 000 000 017 409 121 756 437 807 104;
  • 47) 0.000 000 000 000 017 409 121 756 437 807 104 × 2 = 0 + 0.000 000 000 000 034 818 243 512 875 614 208;
  • 48) 0.000 000 000 000 034 818 243 512 875 614 208 × 2 = 0 + 0.000 000 000 000 069 636 487 025 751 228 416;
  • 49) 0.000 000 000 000 069 636 487 025 751 228 416 × 2 = 0 + 0.000 000 000 000 139 272 974 051 502 456 832;
  • 50) 0.000 000 000 000 139 272 974 051 502 456 832 × 2 = 0 + 0.000 000 000 000 278 545 948 103 004 913 664;
  • 51) 0.000 000 000 000 278 545 948 103 004 913 664 × 2 = 0 + 0.000 000 000 000 557 091 896 206 009 827 328;
  • 52) 0.000 000 000 000 557 091 896 206 009 827 328 × 2 = 0 + 0.000 000 000 001 114 183 792 412 019 654 656;
  • 53) 0.000 000 000 001 114 183 792 412 019 654 656 × 2 = 0 + 0.000 000 000 002 228 367 584 824 039 309 312;
  • 54) 0.000 000 000 002 228 367 584 824 039 309 312 × 2 = 0 + 0.000 000 000 004 456 735 169 648 078 618 624;
  • 55) 0.000 000 000 004 456 735 169 648 078 618 624 × 2 = 0 + 0.000 000 000 008 913 470 339 296 157 237 248;
  • 56) 0.000 000 000 008 913 470 339 296 157 237 248 × 2 = 0 + 0.000 000 000 017 826 940 678 592 314 474 496;
  • 57) 0.000 000 000 017 826 940 678 592 314 474 496 × 2 = 0 + 0.000 000 000 035 653 881 357 184 628 948 992;
  • 58) 0.000 000 000 035 653 881 357 184 628 948 992 × 2 = 0 + 0.000 000 000 071 307 762 714 369 257 897 984;
  • 59) 0.000 000 000 071 307 762 714 369 257 897 984 × 2 = 0 + 0.000 000 000 142 615 525 428 738 515 795 968;
  • 60) 0.000 000 000 142 615 525 428 738 515 795 968 × 2 = 0 + 0.000 000 000 285 231 050 857 477 031 591 936;
  • 61) 0.000 000 000 285 231 050 857 477 031 591 936 × 2 = 0 + 0.000 000 000 570 462 101 714 954 063 183 872;
  • 62) 0.000 000 000 570 462 101 714 954 063 183 872 × 2 = 0 + 0.000 000 001 140 924 203 429 908 126 367 744;
  • 63) 0.000 000 001 140 924 203 429 908 126 367 744 × 2 = 0 + 0.000 000 002 281 848 406 859 816 252 735 488;
  • 64) 0.000 000 002 281 848 406 859 816 252 735 488 × 2 = 0 + 0.000 000 004 563 696 813 719 632 505 470 976;
  • 65) 0.000 000 004 563 696 813 719 632 505 470 976 × 2 = 0 + 0.000 000 009 127 393 627 439 265 010 941 952;
  • 66) 0.000 000 009 127 393 627 439 265 010 941 952 × 2 = 0 + 0.000 000 018 254 787 254 878 530 021 883 904;
  • 67) 0.000 000 018 254 787 254 878 530 021 883 904 × 2 = 0 + 0.000 000 036 509 574 509 757 060 043 767 808;
  • 68) 0.000 000 036 509 574 509 757 060 043 767 808 × 2 = 0 + 0.000 000 073 019 149 019 514 120 087 535 616;
  • 69) 0.000 000 073 019 149 019 514 120 087 535 616 × 2 = 0 + 0.000 000 146 038 298 039 028 240 175 071 232;
  • 70) 0.000 000 146 038 298 039 028 240 175 071 232 × 2 = 0 + 0.000 000 292 076 596 078 056 480 350 142 464;
  • 71) 0.000 000 292 076 596 078 056 480 350 142 464 × 2 = 0 + 0.000 000 584 153 192 156 112 960 700 284 928;
  • 72) 0.000 000 584 153 192 156 112 960 700 284 928 × 2 = 0 + 0.000 001 168 306 384 312 225 921 400 569 856;
  • 73) 0.000 001 168 306 384 312 225 921 400 569 856 × 2 = 0 + 0.000 002 336 612 768 624 451 842 801 139 712;
  • 74) 0.000 002 336 612 768 624 451 842 801 139 712 × 2 = 0 + 0.000 004 673 225 537 248 903 685 602 279 424;
  • 75) 0.000 004 673 225 537 248 903 685 602 279 424 × 2 = 0 + 0.000 009 346 451 074 497 807 371 204 558 848;
  • 76) 0.000 009 346 451 074 497 807 371 204 558 848 × 2 = 0 + 0.000 018 692 902 148 995 614 742 409 117 696;
  • 77) 0.000 018 692 902 148 995 614 742 409 117 696 × 2 = 0 + 0.000 037 385 804 297 991 229 484 818 235 392;
  • 78) 0.000 037 385 804 297 991 229 484 818 235 392 × 2 = 0 + 0.000 074 771 608 595 982 458 969 636 470 784;
  • 79) 0.000 074 771 608 595 982 458 969 636 470 784 × 2 = 0 + 0.000 149 543 217 191 964 917 939 272 941 568;
  • 80) 0.000 149 543 217 191 964 917 939 272 941 568 × 2 = 0 + 0.000 299 086 434 383 929 835 878 545 883 136;
  • 81) 0.000 299 086 434 383 929 835 878 545 883 136 × 2 = 0 + 0.000 598 172 868 767 859 671 757 091 766 272;
  • 82) 0.000 598 172 868 767 859 671 757 091 766 272 × 2 = 0 + 0.001 196 345 737 535 719 343 514 183 532 544;
  • 83) 0.001 196 345 737 535 719 343 514 183 532 544 × 2 = 0 + 0.002 392 691 475 071 438 687 028 367 065 088;
  • 84) 0.002 392 691 475 071 438 687 028 367 065 088 × 2 = 0 + 0.004 785 382 950 142 877 374 056 734 130 176;
  • 85) 0.004 785 382 950 142 877 374 056 734 130 176 × 2 = 0 + 0.009 570 765 900 285 754 748 113 468 260 352;
  • 86) 0.009 570 765 900 285 754 748 113 468 260 352 × 2 = 0 + 0.019 141 531 800 571 509 496 226 936 520 704;
  • 87) 0.019 141 531 800 571 509 496 226 936 520 704 × 2 = 0 + 0.038 283 063 601 143 018 992 453 873 041 408;
  • 88) 0.038 283 063 601 143 018 992 453 873 041 408 × 2 = 0 + 0.076 566 127 202 286 037 984 907 746 082 816;
  • 89) 0.076 566 127 202 286 037 984 907 746 082 816 × 2 = 0 + 0.153 132 254 404 572 075 969 815 492 165 632;
  • 90) 0.153 132 254 404 572 075 969 815 492 165 632 × 2 = 0 + 0.306 264 508 809 144 151 939 630 984 331 264;
  • 91) 0.306 264 508 809 144 151 939 630 984 331 264 × 2 = 0 + 0.612 529 017 618 288 303 879 261 968 662 528;
  • 92) 0.612 529 017 618 288 303 879 261 968 662 528 × 2 = 1 + 0.225 058 035 236 576 607 758 523 937 325 056;
  • 93) 0.225 058 035 236 576 607 758 523 937 325 056 × 2 = 0 + 0.450 116 070 473 153 215 517 047 874 650 112;
  • 94) 0.450 116 070 473 153 215 517 047 874 650 112 × 2 = 0 + 0.900 232 140 946 306 431 034 095 749 300 224;
  • 95) 0.900 232 140 946 306 431 034 095 749 300 224 × 2 = 1 + 0.800 464 281 892 612 862 068 191 498 600 448;
  • 96) 0.800 464 281 892 612 862 068 191 498 600 448 × 2 = 1 + 0.600 928 563 785 225 724 136 382 997 200 896;
  • 97) 0.600 928 563 785 225 724 136 382 997 200 896 × 2 = 1 + 0.201 857 127 570 451 448 272 765 994 401 792;
  • 98) 0.201 857 127 570 451 448 272 765 994 401 792 × 2 = 0 + 0.403 714 255 140 902 896 545 531 988 803 584;
  • 99) 0.403 714 255 140 902 896 545 531 988 803 584 × 2 = 0 + 0.807 428 510 281 805 793 091 063 977 607 168;
  • 100) 0.807 428 510 281 805 793 091 063 977 607 168 × 2 = 1 + 0.614 857 020 563 611 586 182 127 955 214 336;
  • 101) 0.614 857 020 563 611 586 182 127 955 214 336 × 2 = 1 + 0.229 714 041 127 223 172 364 255 910 428 672;
  • 102) 0.229 714 041 127 223 172 364 255 910 428 672 × 2 = 0 + 0.459 428 082 254 446 344 728 511 820 857 344;
  • 103) 0.459 428 082 254 446 344 728 511 820 857 344 × 2 = 0 + 0.918 856 164 508 892 689 457 023 641 714 688;
  • 104) 0.918 856 164 508 892 689 457 023 641 714 688 × 2 = 1 + 0.837 712 329 017 785 378 914 047 283 429 376;
  • 105) 0.837 712 329 017 785 378 914 047 283 429 376 × 2 = 1 + 0.675 424 658 035 570 757 828 094 566 858 752;
  • 106) 0.675 424 658 035 570 757 828 094 566 858 752 × 2 = 1 + 0.350 849 316 071 141 515 656 189 133 717 504;
  • 107) 0.350 849 316 071 141 515 656 189 133 717 504 × 2 = 0 + 0.701 698 632 142 283 031 312 378 267 435 008;
  • 108) 0.701 698 632 142 283 031 312 378 267 435 008 × 2 = 1 + 0.403 397 264 284 566 062 624 756 534 870 016;
  • 109) 0.403 397 264 284 566 062 624 756 534 870 016 × 2 = 0 + 0.806 794 528 569 132 125 249 513 069 740 032;
  • 110) 0.806 794 528 569 132 125 249 513 069 740 032 × 2 = 1 + 0.613 589 057 138 264 250 499 026 139 480 064;
  • 111) 0.613 589 057 138 264 250 499 026 139 480 064 × 2 = 1 + 0.227 178 114 276 528 500 998 052 278 960 128;
  • 112) 0.227 178 114 276 528 500 998 052 278 960 128 × 2 = 0 + 0.454 356 228 553 057 001 996 104 557 920 256;
  • 113) 0.454 356 228 553 057 001 996 104 557 920 256 × 2 = 0 + 0.908 712 457 106 114 003 992 209 115 840 512;
  • 114) 0.908 712 457 106 114 003 992 209 115 840 512 × 2 = 1 + 0.817 424 914 212 228 007 984 418 231 681 024;
  • 115) 0.817 424 914 212 228 007 984 418 231 681 024 × 2 = 1 + 0.634 849 828 424 456 015 968 836 463 362 048;

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...)


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.000 000 000 000 000 000 000 000 000 247 398 5(10) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0011 1001 1001 1101 0110 011(2)


5. Positive number before normalization:

0.000 000 000 000 000 000 000 000 000 247 398 5(10) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0011 1001 1001 1101 0110 011(2)

6. Normalize the binary representation of the number.

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


0.000 000 000 000 000 000 000 000 000 247 398 5(10) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0011 1001 1001 1101 0110 011(2) =


0.0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0011 1001 1001 1101 0110 011(2) × 20 =


1.0011 1001 1001 1101 0110 011(2) × 2-92


7. 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 0 (a positive number)


Exponent (unadjusted): -92


Mantissa (not normalized):
1.0011 1001 1001 1101 0110 011


8. Adjust the exponent.

Use the 8 bit excess/bias notation:


Exponent (adjusted) =


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


-92 + 2(8-1) - 1 =


(-92 + 127)(10) =


35(10)


9. 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;
  • 35 ÷ 2 = 17 + 1;
  • 17 ÷ 2 = 8 + 1;
  • 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) =


35(10) =


0010 0011(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 23 bits, only if necessary (not the case here).


Mantissa (normalized) =


1. 001 1100 1100 1110 1011 0011 =


001 1100 1100 1110 1011 0011


12. The three elements that make up the number's 32 bit single precision IEEE 754 binary floating point representation:

Sign (1 bit) =
0 (a positive number)


Exponent (8 bits) =
0010 0011


Mantissa (23 bits) =
001 1100 1100 1110 1011 0011


The base ten decimal number 0.000 000 000 000 000 000 000 000 000 247 398 5 converted and written in 32 bit single precision IEEE 754 binary floating point representation:
0 - 0010 0011 - 001 1100 1100 1110 1011 0011

The latest decimal numbers converted from base ten to 32 bit single precision IEEE 754 floating point binary standard representation

Number 0.666 666 666 666 666 666 666 666 66 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:18 UTC (GMT)
Number 113 814 969 782 907 170 013 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:17 UTC (GMT)
Number 969 709 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:17 UTC (GMT)
Number 262 788 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:17 UTC (GMT)
Number -1 946 156 971 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:17 UTC (GMT)
Number 23 450 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:17 UTC (GMT)
Number 131.075 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:17 UTC (GMT)
Number 0.002 168 182 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:17 UTC (GMT)
Number -32 100 202 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:17 UTC (GMT)
Number 271 070 converted from decimal system (written in base ten) to 32 bit single precision IEEE 754 binary floating point representation standard May 21 14:17 UTC (GMT)
All base ten decimal numbers converted to 32 bit single precision IEEE 754 binary floating point

How to convert decimal numbers from base ten to 32 bit single precision IEEE 754 binary floating point standard

Follow the steps below to convert a base 10 decimal number to 32 bit single 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 base ten 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 of the previous dividing 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 previous multiplying operations, starting from the top of the constructed list 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, by shifting the decimal point (or if you prefer, the decimal mark) "n" positions either to the left or to the right, so that only one non zero digit remains to the left of the decimal point.
  • 7. Adjust the exponent in 8 bit excess/bias notation and then convert it from decimal (base 10) to 8 bit binary, by using the same technique of repeatedly dividing by 2, as shown above:
    Exponent (adjusted) = Exponent (unadjusted) + 2(8-1) - 1
  • 8. Normalize mantissa, remove the leading (leftmost) bit, since it's allways '1' (and the decimal sign if the case) and adjust its length to 23 bits, either by removing the excess bits from the right (losing precision...) or by adding extra '0' bits 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 -25.347 from decimal system (base ten) to 32 bit single precision IEEE 754 binary floating point:

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

    |-25.347| = 25.347

  • 2. First convert the integer part, 25. Divide it repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:
    • division = quotient + remainder;
    • 25 ÷ 2 = 12 + 1;
    • 12 ÷ 2 = 6 + 0;
    • 6 ÷ 2 = 3 + 0;
    • 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:

    25(10) = 1 1001(2)

  • 4. Then convert the fractional part, 0.347. 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.347 × 2 = 0 + 0.694;
    • 2) 0.694 × 2 = 1 + 0.388;
    • 3) 0.388 × 2 = 0 + 0.776;
    • 4) 0.776 × 2 = 1 + 0.552;
    • 5) 0.552 × 2 = 1 + 0.104;
    • 6) 0.104 × 2 = 0 + 0.208;
    • 7) 0.208 × 2 = 0 + 0.416;
    • 8) 0.416 × 2 = 0 + 0.832;
    • 9) 0.832 × 2 = 1 + 0.664;
    • 10) 0.664 × 2 = 1 + 0.328;
    • 11) 0.328 × 2 = 0 + 0.656;
    • 12) 0.656 × 2 = 1 + 0.312;
    • 13) 0.312 × 2 = 0 + 0.624;
    • 14) 0.624 × 2 = 1 + 0.248;
    • 15) 0.248 × 2 = 0 + 0.496;
    • 16) 0.496 × 2 = 0 + 0.992;
    • 17) 0.992 × 2 = 1 + 0.984;
    • 18) 0.984 × 2 = 1 + 0.968;
    • 19) 0.968 × 2 = 1 + 0.936;
    • 20) 0.936 × 2 = 1 + 0.872;
    • 21) 0.872 × 2 = 1 + 0.744;
    • 22) 0.744 × 2 = 1 + 0.488;
    • 23) 0.488 × 2 = 0 + 0.976;
    • 24) 0.976 × 2 = 1 + 0.952;
    • We didn't get any fractional part that was equal to zero. But we had enough iterations (over Mantissa limit = 23) 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.347(10) = 0.0101 1000 1101 0100 1111 1101(2)

  • 6. Summarizing - the positive number before normalization:

    25.347(10) = 1 1001.0101 1000 1101 0100 1111 1101(2)

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

    25.347(10) =
    1 1001.0101 1000 1101 0100 1111 1101(2) =
    1 1001.0101 1000 1101 0100 1111 1101(2) × 20 =
    1.1001 0101 1000 1101 0100 1111 1101(2) × 24

  • 8. Up to this moment, there are the following elements that would feed into the 32 bit single precision IEEE 754 binary floating point:

    Sign: 1 (a negative number)

    Exponent (unadjusted): 4

    Mantissa (not-normalized): 1.1001 0101 1000 1101 0100 1111 1101

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

    Exponent (adjusted) = Exponent (unadjusted) + 2(8-1) - 1 = (4 + 127)(10) = 131(10) =
    1000 0011(2)

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

    Mantissa (not-normalized): 1.1001 0101 1000 1101 0100 1111 1101

    Mantissa (normalized): 100 1010 1100 0110 1010 0111

  • Conclusion:

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

    Exponent (8 bits) = 1000 0011

    Mantissa (23 bits) = 100 1010 1100 0110 1010 0111

  • Number -25.347, converted from the decimal system (base 10) to 32 bit single precision IEEE 754 binary floating point =
    1 - 1000 0011 - 100 1010 1100 0110 1010 0111