In Unix, is there a built-in calculator?

The following calculator programs exist for Unix systems:

  • bc is the basic calculator. If you enter bc, it will only do integer calculations. However, if you call it with the -l flag (i.e., bc -l), it will do floating-point calculations. For more information on using this calculator, at the Unix prompt, enter:
     man bc
  • dc is the desk calculator. It is very similar to bc, with two major differences: It does floating-point calculations by default, and it uses reverse Polish notation to enter numbers and operators. For example, to add 1 + 2 and to see the result, you would have to type 1 2 + p. Also, dc does not have as many operations available as bc. For more information, at the Unix prompt, enter:
     man dc

To exit bc or dc, press Ctrl-d, or enter quit.

Other third-party calculators may exist on some Unix hosts:

  • calc is another text-based calculator, similar to bc. It is a bit more friendly than bc and can do variable substitutions as well. To find out more about using this program, at the Unix shell prompt, enter:
     man calc
  • xcalc is a graphical scientific calculator that can emulate a TI-30 or an HP-10C scientific calculator. You can run xcalc only in an X Window session.

At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?

This is document acta in the Knowledge Base.
Last modified on 2017-05-16 11:50:09.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.