I need to install bc (I think this is a language so I am guessing I need to install a parser but I seriously have no clue - would I need to install anything else?) onto Ubuntu 12.04 and any additional maths extension that exists for it. The only place I found to try to download it from was from here which had insufficient instructions for me to be able to actually get this done. Looking around on the site the last update appears to be from the year 2000 which made me very wary of trying to install it and I am not even sure if this the place to get it from or not.

I ought to add I really have no clue what I am doing. I need an idiot's guide to the entire installation process.

Really really stuck on this.


Installing bc is trivial:

sudo apt-get install bc

As for extensions, man bc says:

   This version of bc was implemented from the POSIX P1003.2/D11 draft and
   contains several differences and extensions relative to the  draft  and
   traditional  implementations.

Indeed, the manpage is full of things marked 'extension'.

The maths extensions are applied using the -l option:

-l, --mathlib
      Define the standard math library.


$ bc <<<'c(10)'
Runtime error (func=(main), adr=6): Function c not defined.
$ bc -l <<<'c(10)'
| improve this answer | |
  • Thanks. I rejected it. It's not my intention to provide a complete guide to installing software on Ubuntu in this answer. – muru Jul 5 '16 at 5:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.