Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using calc often (from the terminal) and I was wondering if there is a PI constant in there, predefined, somewhere?

share|improve this question
+1 because I like the question. I have spend about 2 hours looking for an answer. – Luis Alvarado Feb 6 '12 at 4:02
up vote 4 down vote accepted

If you are talking about calc from the apcalc package the constant Pi is defined like this:


note, the parentheses are used even though the function does not take any arguments.

not too clear for the GUI desktop calculator,gcalctool, either, which is: Ctrl+P

share|improve this answer
is there a list of those functions? :) – Yanick Rochon Feb 6 '12 at 4:53
Do not know, Pi being so important in my work I have some experience how it is used in many different calculating tools, calc follows the spreadsheet method. – Sabacon Feb 6 '12 at 5:00

you also can choose kcalc there is a scientific - mode in kcalc there again you can choose mathematical constants e.g. PI, Euler, golden ratio ...

if you want to tickle more out of PI in own written program you can use then the library of this library you can use when compiling with gcc resp. g++

have fun !

share|improve this answer
Gnome, the shell I use, also has a graphical scientific calculator. The question was more about the command line program, and was not about programming :) But thanks for sharing this. – Yanick Rochon Aug 29 '12 at 10:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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