Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

2 Answers

up vote 4 down vote accepted

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

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
add comment

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 !

share|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
add comment

Your Answer

 
discard

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.