What is the numeral for base greater than 16 in bc?











up vote
0
down vote

favorite












I recently read about bc and found that it supports obase upto 999. Can anyone point me to the numeral set for bc for base greater than 16.










share|improve this question




















  • 3




    the decimals from 0 to ($base minus one)? echo "obase=20; 20" | bc, echo "obase=20; 39" | bc, echo "obase=20; 40" | bc
    – Jeff Schaller
    Jul 12 '17 at 18:45










  • So, it is a space separated decimal numbers for each digit ?
    – Palash Kanti Kundu
    Jul 12 '17 at 18:50










  • It wouldn't have been particularly difficult for you to try this out yourself.
    – roaima
    Nov 25 at 17:20















up vote
0
down vote

favorite












I recently read about bc and found that it supports obase upto 999. Can anyone point me to the numeral set for bc for base greater than 16.










share|improve this question




















  • 3




    the decimals from 0 to ($base minus one)? echo "obase=20; 20" | bc, echo "obase=20; 39" | bc, echo "obase=20; 40" | bc
    – Jeff Schaller
    Jul 12 '17 at 18:45










  • So, it is a space separated decimal numbers for each digit ?
    – Palash Kanti Kundu
    Jul 12 '17 at 18:50










  • It wouldn't have been particularly difficult for you to try this out yourself.
    – roaima
    Nov 25 at 17:20













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I recently read about bc and found that it supports obase upto 999. Can anyone point me to the numeral set for bc for base greater than 16.










share|improve this question















I recently read about bc and found that it supports obase upto 999. Can anyone point me to the numeral set for bc for base greater than 16.







bc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 at 15:12









Rui F Ribeiro

38.3k1475126




38.3k1475126










asked Jul 12 '17 at 18:38









Palash Kanti Kundu

596




596








  • 3




    the decimals from 0 to ($base minus one)? echo "obase=20; 20" | bc, echo "obase=20; 39" | bc, echo "obase=20; 40" | bc
    – Jeff Schaller
    Jul 12 '17 at 18:45










  • So, it is a space separated decimal numbers for each digit ?
    – Palash Kanti Kundu
    Jul 12 '17 at 18:50










  • It wouldn't have been particularly difficult for you to try this out yourself.
    – roaima
    Nov 25 at 17:20














  • 3




    the decimals from 0 to ($base minus one)? echo "obase=20; 20" | bc, echo "obase=20; 39" | bc, echo "obase=20; 40" | bc
    – Jeff Schaller
    Jul 12 '17 at 18:45










  • So, it is a space separated decimal numbers for each digit ?
    – Palash Kanti Kundu
    Jul 12 '17 at 18:50










  • It wouldn't have been particularly difficult for you to try this out yourself.
    – roaima
    Nov 25 at 17:20








3




3




the decimals from 0 to ($base minus one)? echo "obase=20; 20" | bc, echo "obase=20; 39" | bc, echo "obase=20; 40" | bc
– Jeff Schaller
Jul 12 '17 at 18:45




the decimals from 0 to ($base minus one)? echo "obase=20; 20" | bc, echo "obase=20; 39" | bc, echo "obase=20; 40" | bc
– Jeff Schaller
Jul 12 '17 at 18:45












So, it is a space separated decimal numbers for each digit ?
– Palash Kanti Kundu
Jul 12 '17 at 18:50




So, it is a space separated decimal numbers for each digit ?
– Palash Kanti Kundu
Jul 12 '17 at 18:50












It wouldn't have been particularly difficult for you to try this out yourself.
– roaima
Nov 25 at 17:20




It wouldn't have been particularly difficult for you to try this out yourself.
– roaima
Nov 25 at 17:20










2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










Yes, bc can process numbers with bases up to 999.



As an example:



$ echo "ibase=10;obase=40;3*40^2+7" | bc
03 00 07


Or, as it should be "307" = 3*40^2 + 0*40^1 + 7*40^0. Or 4807 in decimal.



$  echo "ibase=10;obase=10;3*40^2+7" | bc
4807


So, the values are printed as a two digit (decimal) number with an space as separator.

Some other example:



$ echo "ibase=10;obase=530;371*530^9+222*530^3+127" | bc
371 000 000 000 000 000 222 000 000 127


Or, maybe (in bash), the same number:



$ bc <<<"obase=530;1224212292558591376050694127"
371 000 000 000 000 000 222 000 000 127





share|improve this answer




























    up vote
    6
    down vote













    This is covered in the manual page for bc:




    For bases greater than 16, bc uses a multi-character digit method of printing the numbers where each higher base digit is printed as a base 10 number. The multi-character digits are separated by spaces. Each digit contains the number of characters required to represent the base ten value of "obase-1".







    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














       

      draft saved


      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f378036%2fwhat-is-the-numeral-for-base-greater-than-16-in-bc%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote



      accepted










      Yes, bc can process numbers with bases up to 999.



      As an example:



      $ echo "ibase=10;obase=40;3*40^2+7" | bc
      03 00 07


      Or, as it should be "307" = 3*40^2 + 0*40^1 + 7*40^0. Or 4807 in decimal.



      $  echo "ibase=10;obase=10;3*40^2+7" | bc
      4807


      So, the values are printed as a two digit (decimal) number with an space as separator.

      Some other example:



      $ echo "ibase=10;obase=530;371*530^9+222*530^3+127" | bc
      371 000 000 000 000 000 222 000 000 127


      Or, maybe (in bash), the same number:



      $ bc <<<"obase=530;1224212292558591376050694127"
      371 000 000 000 000 000 222 000 000 127





      share|improve this answer

























        up vote
        1
        down vote



        accepted










        Yes, bc can process numbers with bases up to 999.



        As an example:



        $ echo "ibase=10;obase=40;3*40^2+7" | bc
        03 00 07


        Or, as it should be "307" = 3*40^2 + 0*40^1 + 7*40^0. Or 4807 in decimal.



        $  echo "ibase=10;obase=10;3*40^2+7" | bc
        4807


        So, the values are printed as a two digit (decimal) number with an space as separator.

        Some other example:



        $ echo "ibase=10;obase=530;371*530^9+222*530^3+127" | bc
        371 000 000 000 000 000 222 000 000 127


        Or, maybe (in bash), the same number:



        $ bc <<<"obase=530;1224212292558591376050694127"
        371 000 000 000 000 000 222 000 000 127





        share|improve this answer























          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Yes, bc can process numbers with bases up to 999.



          As an example:



          $ echo "ibase=10;obase=40;3*40^2+7" | bc
          03 00 07


          Or, as it should be "307" = 3*40^2 + 0*40^1 + 7*40^0. Or 4807 in decimal.



          $  echo "ibase=10;obase=10;3*40^2+7" | bc
          4807


          So, the values are printed as a two digit (decimal) number with an space as separator.

          Some other example:



          $ echo "ibase=10;obase=530;371*530^9+222*530^3+127" | bc
          371 000 000 000 000 000 222 000 000 127


          Or, maybe (in bash), the same number:



          $ bc <<<"obase=530;1224212292558591376050694127"
          371 000 000 000 000 000 222 000 000 127





          share|improve this answer












          Yes, bc can process numbers with bases up to 999.



          As an example:



          $ echo "ibase=10;obase=40;3*40^2+7" | bc
          03 00 07


          Or, as it should be "307" = 3*40^2 + 0*40^1 + 7*40^0. Or 4807 in decimal.



          $  echo "ibase=10;obase=10;3*40^2+7" | bc
          4807


          So, the values are printed as a two digit (decimal) number with an space as separator.

          Some other example:



          $ echo "ibase=10;obase=530;371*530^9+222*530^3+127" | bc
          371 000 000 000 000 000 222 000 000 127


          Or, maybe (in bash), the same number:



          $ bc <<<"obase=530;1224212292558591376050694127"
          371 000 000 000 000 000 222 000 000 127






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 12 '17 at 19:51









          Arrow

          2,460218




          2,460218
























              up vote
              6
              down vote













              This is covered in the manual page for bc:




              For bases greater than 16, bc uses a multi-character digit method of printing the numbers where each higher base digit is printed as a base 10 number. The multi-character digits are separated by spaces. Each digit contains the number of characters required to represent the base ten value of "obase-1".







              share|improve this answer

























                up vote
                6
                down vote













                This is covered in the manual page for bc:




                For bases greater than 16, bc uses a multi-character digit method of printing the numbers where each higher base digit is printed as a base 10 number. The multi-character digits are separated by spaces. Each digit contains the number of characters required to represent the base ten value of "obase-1".







                share|improve this answer























                  up vote
                  6
                  down vote










                  up vote
                  6
                  down vote









                  This is covered in the manual page for bc:




                  For bases greater than 16, bc uses a multi-character digit method of printing the numbers where each higher base digit is printed as a base 10 number. The multi-character digits are separated by spaces. Each digit contains the number of characters required to represent the base ten value of "obase-1".







                  share|improve this answer












                  This is covered in the manual page for bc:




                  For bases greater than 16, bc uses a multi-character digit method of printing the numbers where each higher base digit is printed as a base 10 number. The multi-character digits are separated by spaces. Each digit contains the number of characters required to represent the base ten value of "obase-1".








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 12 '17 at 18:56









                  user4556274

                  5,33811224




                  5,33811224






























                       

                      draft saved


                      draft discarded



















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f378036%2fwhat-is-the-numeral-for-base-greater-than-16-in-bc%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Accessing regular linux commands in Huawei's Dopra Linux

                      Can't connect RFCOMM socket: Host is down

                      Kernel panic - not syncing: Fatal Exception in Interrupt