You are on page 1of 2

GNU Calc Reference Card

(for version 2.02 of January 1992)

add, subtract, multiply, divide raise to a power, nth root change sign reciprocal 1/x square root x set precision round o last two digits convert to fraction, oat enter using algebraic notation refer to previous result refer to higher stack entries nish alg entry without evaluating set mode where alg entry used by default +, -, *, / ^, I ^ n & Q p c2 c F, c f 2+3*4 3*$^2 $1*$2^2 LFD ma

Scientic Functions
ln, log10 , logb exponential ex , 10x sin, cos, tan arcsin, arccos, arctan inverse, hyperbolic prex keys two-argument arctan degrees, radians modes pi () factorial, double factorial combinations, permutations prime factorization next prime, previous prime GCD, LCM random number, shue minimum, maximum error functions erf, erfc gamma, beta functions incomplete gamma, beta functions Bessel J , Y functions complex magnitude, arg, conjugate real, imaginary parts convert polar/rectangular L, H L, B E, H E S, C, T I S, I C, I T I, H fT m d, m r P !, k k c, kf k n, k g, k r, f n, f f f f e, g, G, j, d Hk c I k k f I f f f k n l h x f e b B y

Starting and Stopping

start/stop standard Calc start/stop X keypad Calc start/stop either: M-# # or M-# M-# stop standard Calc Calc tutorial run Calc in other window quick calculation in minibuer M-# c M-# k q M-# t M-# o M-# q

Getting Help
The h prex key is Calcs analogue of C-h in Emacs. quick summary of keys describe key briey describe key fully describe function or command read on-line manual read full Calc summary ? h h h h h c k f i or M-# i s or M-# s

Stack Commands
Here Sn is the nth stack entry, and N is the size of the stack. key no prex prex n prex n RET copy S1 copy S1..n copy Sn LFD copy S2 copy Sn copy S1..n DEL delete S1 delete S1..n delete Sn M-DEL delete S2 delete Sn delete S1..n TAB swap S1 S2 roll S1 to Sn roll Sn to SN M-TAB roll S3 to S1 roll Sn to S1 roll SN to Sn With a 0 prex, these copy, delete, or reverse S1..N .

A, G, J f r, f i cp

Error Recovery
abort command in progress display recent error messages undo last operation redo last operation recall last arguments edit top of stack reset Calc to default state C-g w U D M-RET M-# 0 (zero)

Financial Functions
enter percentage convert to percentage percentage change M-% c% b% b b b b b b P F T # M N, b I

scroll horizontally, vertically home cursor line numbers on/o trail display on/o scientic notation xed-point notation oating-point (normal) notation group digits with commas < >, { } o dl td d d d d s f n g

Transferring Data
grab grab grab grab region from a buer rectangle from a buer rectangle, summing columns rectangle, summing rows M-# M-# M-# M-# g r : _

present value future value rate of return number of payments size of payments net present value, int. rate of return

Above computations assume payments at end of period. Use I prex for beginning of period, or H for a lump sum investment. straight-line depreciation sum-of-years-digits double declining balance bS bY bD

For display mode commands, H prex prevents screen redraw and I prex temporarily redraws top of stack.

yank data to a buer Also, try C-k/C-y or X cut and paste.

M-# y

scientic notation minus sign in numeric entry fractions complex numbers polar complex numbers vectors (commas optional) matrices (or nested vectors) error forms (p key) interval forms modulo forms (M key) HMS forms date forms innity, indeterminate 6.02e23 _23 or 23 n 3:4 (x, y) (r; ) [1, 2, 3] [1, 2; 3, 4] 100 +/- 0.5 [2 .. 5) 6 mod 24 5@ 30 0" <Jul 4, 1992> inf, nan

enter with units convert to new units, base units convert temperature units simplify units expression view units table u u u u 55 mi/hr c, u b t s v

In RPN, enter numbers rst, separated by RET if necessary, then type the operator. To enter a calculation in algebraic form, press the apostrophe rst. Example: Example: Example: Example: Example: RPN 2 RET 2 RET 2 RET 3 RET P 3 / style: 3 + 3 + 4 * 3 RET 4 + * 6 + Q 3 ^ n S algebraic style: 2+3 RET (2+3)*4 RET 2*(3+4) RET sqrt(3+6)^3 RET sin(-pi/3) RET =

Common units: distance: m, cm, mm, km; in, ft, mi, mfi; point, lyr volume: l or L, ml; gal, qt, pt, cup, floz, tbsp, tsp mass: g, mg, kg, t; lb, oz, ton time: s or sec, ms, us, ns, min, hr, day, wk temperature: degC, degF, K

c 1992 Free Software Foundation, Inc. Permissions on back. v2.02

GNU Calc Reference Card

Programmers Functions
binary, octal, hex display decimal, other radix display display leading zeros entering non-decimal numbers binary word size binary AND, OR, XOR binary DIFF, NOT left shift logical right shift arithmetic right shift integer quotient, remainder integer square root, logarithm oor, ceiling, round to integer d 2, d 8, d 6 d 0, d r dz 16#7FFF b b b b b b w a, b o, b x d, b n l r R

enter an algebraic formula enter an equation symbolic (vs. numeric) mode fractions (vs. oat) mode suppress evaluation of formulas simplify formulas automatically return to default evaluation rules Big display mode C, Pascal, FORTRAN modes TEX, eqn modes Unformatted mode Normal language mode 2x+3y^2 2x^2=18 m m m m m d d d d d s f O S D B C, d P, d F T, d E U N

select subformula under cursor select nth subformula select more unselect this, all formulas copy indicated subformula delete indicated subformula commute selected terms commute term leftward, rightward distribute, merge selection isolate selected term in equation negate, invert term in context rewrite selected term j j j j s n m u, j c

j RET j DEL j j j j j j C L, j R D, j M I N, j & r

\, % f Q, f I F, I F, R

Variable names are single digits or whole words. store to variable store and keep on stack recall from variable shorthands for digit variables unstore, exchange variable edit variable s s s t s s t s r n, s n, r n u, s x e

simplify formula as put formula into rational form an evaluate variables in formula = evaluate numerically N let variable equal a value in formula s l x =val declare properties of variable sd Common decls: pos, int, real, scalar, [a..b ]. expand, collect terms factor, partial fractions polynomial quotient, remainder, GCD derivative, integral taylor series principal solution to equation(s) list of solutions generic solution apply function to both sides of eqn a a a a a a a H a x, f, \, d, t a a a a c a %, a g i

graph function or data graph 3D function or data replot current graph print current graph add curve to graph set number of data points set line, point styles set log vs. linear x, y axis set range for x, y axis close graphics window g g g g g g g g g g f F p P a N s, g S l, g L r, g R q

Vector Operations
vector of 1, 2, . . . , n vector of n counts from a by b vector of copies of a value concatenate into vector pack many stack items into vector unpack vector or object length of vector (list) reverse vector sort, grade vector histogram of vector data extract vector element matrix determinant, inverse matrix transpose, trace cross, dot products identity matrix extract matrix row, column intersection, union, di of sets cardinality of set add vectors elementwise (i.e., map +) sum elements in vector (i.e., reduce +) sum rows in matrix sum columns in matrix sum elements, accumulate results vx n C-u v x vb | vp vu v v V V v V v V v v l v S, V G H r D, t, C, i r, & VT * vc

S P a S M

begin, end recording a macro replay keyboard macro read region as written-out macro if, else, endif equal to, less than, member of repeat n times, break from loop for loop: start, end; body, step save, restore mode settings display message during macro query user during macro put nished macro on a key dene function with formula edit denition record user-dened command permanently record variable value permanently record mode settings permanently C-x (, X M-# m Z [, Z a =, a Z <, Z Z (, Z Z , Z Z= Z# ZK ZF ZE ZP sp mm C-x ) :, Z ] <, a { >, Z / )

rewrite formula ar Example: a r a*b + a*c := a*(b+c) Example: a r sin(x)^2 := 1-cos(x)^2 Example: a r cos(n pi) := 1 :: integer(n) :: n%2 = 0 Example: a r [f(0) := 1, f(n) := n f(n-1) :: n > 0] Put rules in EvalRules to have them apply automatically. Put rules in AlgSimpRules to apply during a s command. Common markers: opt, plain, quote, eval, let, remember.

Numerical Computations
sum formula over a range product of formula over a range tabulate formula over a range integrate numerically over a range nd zero of formula or equation nd local min, max of formula t data to line or curve mean of data in vector or variable median of data geometric mean of data sum, product of data minimum, maximum of data sample, pop. standard deviation a a a a a a a u H u u u u + * T I R N, a X F M u M G +, u * N, u X S, I u S

V ^, V V, V V# V V V V V M R R R U + + _+ :+ +

Copyright c 1992 Free Software Foundation, Inc. designed by Dave Gillespie and Stephen Gildea, v2.02 for GNU Emacs Calc version 2.02 (January 1992) Permission is granted to make and distribute copies of this card provided the copyright notice and this permission notice are preserved on all copies. For copies of the GNU Emacs Calc manual, write to the Free Software Foundation, Inc., 675 Massachusetts Ave, Cambridge MA 02139.