8

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

  • +1 because I like the question. I have spend about 2 hours looking for an answer. – Luis Alvarado Feb 6 '12 at 4:02
7

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

pi() 

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

|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
0

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 http://gmplib.org/ this library you can use when compiling with gcc resp. g++

have fun !

|improve this answer|||||
  • 1
    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 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.