151 516 161 616 199 998 989 989.150 971 Converted to 32 Bit Single Precision IEEE 754 Binary Floating Point Representation Standard

Convert decimal 151 516 161 616 199 998 989 989.150 971(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
151 516 161 616 199 998 989 989.150 971(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. First, convert to binary (in base 2) the integer part: 151 516 161 616 199 998 989 989.
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;
  • 151 516 161 616 199 998 989 989 ÷ 2 = 75 758 080 808 099 999 494 994 + 1;
  • 75 758 080 808 099 999 494 994 ÷ 2 = 37 879 040 404 049 999 747 497 + 0;
  • 37 879 040 404 049 999 747 497 ÷ 2 = 18 939 520 202 024 999 873 748 + 1;
  • 18 939 520 202 024 999 873 748 ÷ 2 = 9 469 760 101 012 499 936 874 + 0;
  • 9 469 760 101 012 499 936 874 ÷ 2 = 4 734 880 050 506 249 968 437 + 0;
  • 4 734 880 050 506 249 968 437 ÷ 2 = 2 367 440 025 253 124 984 218 + 1;
  • 2 367 440 025 253 124 984 218 ÷ 2 = 1 183 720 012 626 562 492 109 + 0;
  • 1 183 720 012 626 562 492 109 ÷ 2 = 591 860 006 313 281 246 054 + 1;
  • 591 860 006 313 281 246 054 ÷ 2 = 295 930 003 156 640 623 027 + 0;
  • 295 930 003 156 640 623 027 ÷ 2 = 147 965 001 578 320 311 513 + 1;
  • 147 965 001 578 320 311 513 ÷ 2 = 73 982 500 789 160 155 756 + 1;
  • 73 982 500 789 160 155 756 ÷ 2 = 36 991 250 394 580 077 878 + 0;
  • 36 991 250 394 580 077 878 ÷ 2 = 18 495 625 197 290 038 939 + 0;
  • 18 495 625 197 290 038 939 ÷ 2 = 9 247 812 598 645 019 469 + 1;
  • 9 247 812 598 645 019 469 ÷ 2 = 4 623 906 299 322 509 734 + 1;
  • 4 623 906 299 322 509 734 ÷ 2 = 2 311 953 149 661 254 867 + 0;
  • 2 311 953 149 661 254 867 ÷ 2 = 1 155 976 574 830 627 433 + 1;
  • 1 155 976 574 830 627 433 ÷ 2 = 577 988 287 415 313 716 + 1;
  • 577 988 287 415 313 716 ÷ 2 = 288 994 143 707 656 858 + 0;
  • 288 994 143 707 656 858 ÷ 2 = 144 497 071 853 828 429 + 0;
  • 144 497 071 853 828 429 ÷ 2 = 72 248 535 926 914 214 + 1;
  • 72 248 535 926 914 214 ÷ 2 = 36 124 267 963 457 107 + 0;
  • 36 124 267 963 457 107 ÷ 2 = 18 062 133 981 728 553 + 1;
  • 18 062 133 981 728 553 ÷ 2 = 9 031 066 990 864 276 + 1;
  • 9 031 066 990 864 276 ÷ 2 = 4 515 533 495 432 138 + 0;
  • 4 515 533 495 432 138 ÷ 2 = 2 257 766 747 716 069 + 0;
  • 2 257 766 747 716 069 ÷ 2 = 1 128 883 373 858 034 + 1;
  • 1 128 883 373 858 034 ÷ 2 = 564 441 686 929 017 + 0;
  • 564 441 686 929 017 ÷ 2 = 282 220 843 464 508 + 1;
  • 282 220 843 464 508 ÷ 2 = 141 110 421 732 254 + 0;
  • 141 110 421 732 254 ÷ 2 = 70 555 210 866 127 + 0;
  • 70 555 210 866 127 ÷ 2 = 35 277 605 433 063 + 1;
  • 35 277 605 433 063 ÷ 2 = 17 638 802 716 531 + 1;
  • 17 638 802 716 531 ÷ 2 = 8 819 401 358 265 + 1;
  • 8 819 401 358 265 ÷ 2 = 4 409 700 679 132 + 1;
  • 4 409 700 679 132 ÷ 2 = 2 204 850 339 566 + 0;
  • 2 204 850 339 566 ÷ 2 = 1 102 425 169 783 + 0;
  • 1 102 425 169 783 ÷ 2 = 551 212 584 891 + 1;
  • 551 212 584 891 ÷ 2 = 275 606 292 445 + 1;
  • 275 606 292 445 ÷ 2 = 137 803 146 222 + 1;
  • 137 803 146 222 ÷ 2 = 68 901 573 111 + 0;
  • 68 901 573 111 ÷ 2 = 34 450 786 555 + 1;
  • 34 450 786 555 ÷ 2 = 17 225 393 277 + 1;
  • 17 225 393 277 ÷ 2 = 8 612 696 638 + 1;
  • 8 612 696 638 ÷ 2 = 4 306 348 319 + 0;
  • 4 306 348 319 ÷ 2 = 2 153 174 159 + 1;
  • 2 153 174 159 ÷ 2 = 1 076 587 079 + 1;
  • 1 076 587 079 ÷ 2 = 538 293 539 + 1;
  • 538 293 539 ÷ 2 = 269 146 769 + 1;
  • 269 146 769 ÷ 2 = 134 573 384 + 1;
  • 134 573 384 ÷ 2 = 67 286 692 + 0;
  • 67 286 692 ÷ 2 = 33 643 346 + 0;
  • 33 643 346 ÷ 2 = 16 821 673 + 0;
  • 16 821 673 ÷ 2 = 8 410 836 + 1;
  • 8 410 836 ÷ 2 = 4 205 418 + 0;
  • 4 205 418 ÷ 2 = 2 102 709 + 0;
  • 2 102 709 ÷ 2 = 1 051 354 + 1;
  • 1 051 354 ÷ 2 = 525 677 + 0;
  • 525 677 ÷ 2 = 262 838 + 1;
  • 262 838 ÷ 2 = 131 419 + 0;
  • 131 419 ÷ 2 = 65 709 + 1;
  • 65 709 ÷ 2 = 32 854 + 1;
  • 32 854 ÷ 2 = 16 427 + 0;
  • 16 427 ÷ 2 = 8 213 + 1;
  • 8 213 ÷ 2 = 4 106 + 1;
  • 4 106 ÷ 2 = 2 053 + 0;
  • 2 053 ÷ 2 = 1 026 + 1;
  • 1 026 ÷ 2 = 513 + 0;
  • 513 ÷ 2 = 256 + 1;
  • 256 ÷ 2 = 128 + 0;
  • 128 ÷ 2 = 64 + 0;
  • 64 ÷ 2 = 32 + 0;
  • 32 ÷ 2 = 16 + 0;
  • 16 ÷ 2 = 8 + 0;
  • 8 ÷ 2 = 4 + 0;
  • 4 ÷ 2 = 2 + 0;
  • 2 ÷ 2 = 1 + 0;
  • 1 ÷ 2 = 0 + 1;

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.

151 516 161 616 199 998 989 989(10) =


10 0000 0001 0101 1011 0101 0010 0011 1110 1110 1110 0111 1001 0100 1101 0011 0110 0110 1010 0101(2)


3. Convert to binary (base 2) the fractional part: 0.150 971.

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.150 971 × 2 = 0 + 0.301 942;
  • 2) 0.301 942 × 2 = 0 + 0.603 884;
  • 3) 0.603 884 × 2 = 1 + 0.207 768;
  • 4) 0.207 768 × 2 = 0 + 0.415 536;
  • 5) 0.415 536 × 2 = 0 + 0.831 072;
  • 6) 0.831 072 × 2 = 1 + 0.662 144;
  • 7) 0.662 144 × 2 = 1 + 0.324 288;
  • 8) 0.324 288 × 2 = 0 + 0.648 576;
  • 9) 0.648 576 × 2 = 1 + 0.297 152;
  • 10) 0.297 152 × 2 = 0 + 0.594 304;
  • 11) 0.594 304 × 2 = 1 + 0.188 608;
  • 12) 0.188 608 × 2 = 0 + 0.377 216;
  • 13) 0.377 216 × 2 = 0 + 0.754 432;
  • 14) 0.754 432 × 2 = 1 + 0.508 864;
  • 15) 0.508 864 × 2 = 1 + 0.017 728;
  • 16) 0.017 728 × 2 = 0 + 0.035 456;
  • 17) 0.035 456 × 2 = 0 + 0.070 912;
  • 18) 0.070 912 × 2 = 0 + 0.141 824;
  • 19) 0.141 824 × 2 = 0 + 0.283 648;
  • 20) 0.283 648 × 2 = 0 + 0.567 296;
  • 21) 0.567 296 × 2 = 1 + 0.134 592;
  • 22) 0.134 592 × 2 = 0 + 0.269 184;
  • 23) 0.269 184 × 2 = 0 + 0.538 368;
  • 24) 0.538 368 × 2 = 1 + 0.076 736;

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


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.150 971(10) =


0.0010 0110 1010 0110 0000 1001(2)

5. Positive number before normalization:

151 516 161 616 199 998 989 989.150 971(10) =


10 0000 0001 0101 1011 0101 0010 0011 1110 1110 1110 0111 1001 0100 1101 0011 0110 0110 1010 0101.0010 0110 1010 0110 0000 1001(2)

6. Normalize the binary representation of the number.

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


151 516 161 616 199 998 989 989.150 971(10) =


10 0000 0001 0101 1011 0101 0010 0011 1110 1110 1110 0111 1001 0100 1101 0011 0110 0110 1010 0101.0010 0110 1010 0110 0000 1001(2) =


10 0000 0001 0101 1011 0101 0010 0011 1110 1110 1110 0111 1001 0100 1101 0011 0110 0110 1010 0101.0010 0110 1010 0110 0000 1001(2) × 20 =


1.0000 0000 1010 1101 1010 1001 0001 1111 0111 0111 0011 1100 1010 0110 1001 1011 0011 0101 0010 1001 0011 0101 0011 0000 0100 1(2) × 277


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): 77


Mantissa (not normalized):
1.0000 0000 1010 1101 1010 1001 0001 1111 0111 0111 0011 1100 1010 0110 1001 1011 0011 0101 0010 1001 0011 0101 0011 0000 0100 1


8. Adjust the exponent.

Use the 8 bit excess/bias notation:


Exponent (adjusted) =


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


77 + 2(8-1) - 1 =


(77 + 127)(10) =


204(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;
  • 204 ÷ 2 = 102 + 0;
  • 102 ÷ 2 = 51 + 0;
  • 51 ÷ 2 = 25 + 1;
  • 25 ÷ 2 = 12 + 1;
  • 12 ÷ 2 = 6 + 0;
  • 6 ÷ 2 = 3 + 0;
  • 3 ÷ 2 = 1 + 1;
  • 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) =


204(10) =


1100 1100(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, 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. 000 0000 0101 0110 1101 0100 10 0011 1110 1110 1110 0111 1001 0100 1101 0011 0110 0110 1010 0101 0010 0110 1010 0110 0000 1001 =


000 0000 0101 0110 1101 0100


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) =
1100 1100


Mantissa (23 bits) =
000 0000 0101 0110 1101 0100


Decimal number 151 516 161 616 199 998 989 989.150 971 converted to 32 bit single precision IEEE 754 binary floating point representation:

0 - 1100 1100 - 000 0000 0101 0110 1101 0100


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