Table of Contents
In Emacs, execute
M-x calc and you are in a
Calc buffer. At first
time, perhaps you will be confused how begin. Press
? you will get a
Normally, Calc uses the RPN (Reverse Polish Notation) notation, which is not the natation what I am familiar with. However, It did not take me much time to get used to it. Generally, the core of an RPN calculator is the stack. A calculator stack is like a stack of dishes. New dishes are added at the top of the stack, and numbers are normally only removed from the top of the stack. Also, in a RPN calculator, operands are always entered first, the operator second. The calculator pops the appropriate number of operands from the stack and pushes back the result.
2+3 for example, first, you enter 2;second , 3; at last, you
+ . Then the 2 and 3 pops from the stack and 5 are pushed on
the top of the stack.
2 Main Features
- Choice of algebraic or RPN entry of calculations;
- Arbitrary precision integers and floating-point numbers.
- Arithmetic on rational numbers, complex numbers (rectangular and polar), error forms with standard deviations, open and closed intervals, vectors and matrices, dates and times, infinities, sets, quantities with units, and algebraic formulas.
- Mathematical operations such as logarithms and trigonometric functions.
- Programmer’s features (bitwise operations, non-decimal numbers).
- Financial functions such as future value and internal rate of return.
- Number theoretical features such as prime factorization and arithmetic modulo m for any m.
- Algebraic manipulation features, including symbolic calculus.
- Moving data to and from regular editing buffers.
- Embedded mode for manipulating Calc formulas and data directly inside any editing buffer.
- Graphics using GNUPLOT, a versatile (and free) plotting program.
- Easy programming using keyboard macros, algebraic formulas, algebraic rewrite rules, or extended Emacs Lisp.
From the features listed above, we can see Calc is a versatile calculator. It is almost impossible for me to touch all the features during daily use. Calc is large and maybe intimidating to the first-time user. My knowledge of Calc grows as time goes by. I use Calc every time when I want to calculate something. Day by day, I learn more and more about Calc.
This post is the record of my use of Calc.
3 switch between the algebraic and RPN mode
This command is used to input an expression in the algebraic mode
temporally. After this the Calc is in RPN mode. When you execute
calc-algebraic-entry the minibuffer will be leading by the
word Algebraic: instead of Calc:, which is used in the RPN
After the Algebraic: you can enter your algebraic expression.
In the Calc buffer, press
' also bring you the algebraic mode.
' two times bring you the last algebraic expression you
This command will turn the Calc into algebraic mode. After calling
this command, every time you enter something in the Calc buffer,
the Calc is in the algebraic mode i.e. every time you enter
something , the minibuffer will be leading Algebraic: . So any
algebraic expression is accepted. I even try the
2 + log10(100)
and it returns
4 adding two numbers
In the RPN mode, you enter the first operand and the second
operand, at last you enter
+ , then the first operand and the
second operand pops out of the stack and the result is pushed
subtraction, multiplication and divide are in a straightforward way.