calc_ref

Upload: dick-button

Post on 07-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 calc_ref

    1/2

    GNU Calc Reference Card(for version 2.02 of January 1992)

    Starting and Stopping

    start/stop standard Calc M-# cstart/stop X keypad Calc M-# k

    start/stop either: M-# # or M-# M-#stop standard Calc q

    Calc tutorial M-# trun Calc in other window M-# o

    quick calculation in minibuffer M-# q

    Getting Help

    The h prefix key is Calcs analogue of C-h in Emacs.

    quick summary of keys ?describe key briefly h cdescribe key fully h kdescribe function or command h fread on-line manual h i or M-# iread full Calc summary h s or M-# s

    Error Recovery

    abort command in progress C-gdisplay recent error messages wundo last operation Uredo last operation Drecall last arguments M-RETedit top of stack reset Calc to default state M-# 0 (zero)

    Transferring Data

    grab region from a buffer M-# ggrab rectangle from a buffer M-# rgrab rectangle, summing columns M-# :grab rectangle, summing rows M-# _

    yank data to a buffer M-# yAlso, try C-k/C-y or X cut and paste.

    Examples

    In RPN, enter numbers first, separated by RET if necessary,then type the operator. To enter a calculation in algebraicform, press the apostrophe first.

    R PN styl e: a lg ebr ai c s ty le :Example: 2 RET 3 + 2+3 RETExample: 2 RET 3 + 4 * (2+3)*4 RETExample: 2 RE T 3 R ET 4 + * 2* (3 +4 ) RE TExample: 3 RET 6 + Q 3 ^ sqrt(3+6)^3 RETExample: P 3 / n S sin(-pi/3) RET =

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

    Arithmetic

    add, subtract, multiply, divide +, -, *, /raise to a power, nth root ^, I ^change sign nreciprocal 1/x &square root

    x Q

    set precision pround off last two digits c 2convert to fraction, float c F, c f

    enter using algebraic notation 2+3*4refer to previous result 3*$ 2refer to higher stack entries $1*$2 2finish alg entry without evaluating LFDset mode where alg entry used by default m a

    Stack Commands

    Here Sn is the nth stack entry, and N is the size of the stack.

    key no prefix prefix n prefixnRET copy S1 copy S1..n copy SnLFD copy S2 copy Sn copy S1..nDEL delete S1 delete S1..n delete SnM-DEL delete S2 delete Sn delete S1..nTAB swap S1S2 roll S1 to Sn roll Sn to SNM-TAB roll S3 to S1 roll Sn to S1 roll SN to Sn

    With a 0 prefix, these copy, delete, or reverse S1..N .

    Display

    scroll horizontally, vertically < >, { }home cursor oline numbers on/off d ltrail display on/off t d

    scientific notation d sfixed-point notation d ffloating-point (normal) notation d ngroup digits with commas d g

    For display mode commands, H prefix prevents screen redrawand I prefix temporarily redraws top of stack.

    Notations

    scientific notation 6.02e23minus sign in numeric entry _23 or 23 nfractions 3:4complex numbers (x, y)polar complex numbers (r; )vectors (commas optional) [1, 2, 3]matrices (or nested vectors) [1, 2; 3, 4]error forms (p key) 100 +/- 0.5interval forms [2 .. 5)modulo forms (M key) 6 mod 24HMS forms 5@ 30 0"date forms

    infinity, indeterminate inf, nan

    Scientific Functions

    ln, log10, logb L, H L, Bexponential ex, 10x E, H Esin, cos, tan S, C, Tarcsin, arccos, arctan I S, I C, I Tinverse, hyperbolic prefix keys I, Htwo-argument arctan f Tdegrees, radians modes m d, m rpi () P

    factorial, double factorial !, k dcombinations, permutations k c, H k c

    prime factorization k fnext prime, previous prime k n, I k nGCD, LCM k g, k lrandom number, shuffle k r, k hminimum, maximum f n, f x

    error functions erf, erfc f e, I f egamma, beta functions f g, f bincomplete gamma, beta functions f G, f BBessel J , Y functions f j, f y

    complex magnitude, arg, conjugate A, G, Jreal, imaginary parts f r, f iconvert polar/rectangular c p

    Financial Functions

    enter percentage M-%convert to percentage c %percentage change b %

    present value b Pfuture value b Frate of return b Tnumber of payments b #size of payments b Mnet present value, int. rate of return b N, b I

    Above computations assume payments at end of period. Use Iprefix for beginning of period, or H for a lump sum investment.

    straight-line depreciation b Ssum-of-years-digits b Y

    double declining balance b D

    Units

    enter with units 55 mi/hrconvert to new units, base units u c, u bconvert temperature units u tsimplify units expression u sview units table u v

    Common units:distance: m, cm, mm, km; in, ft, mi, mfi; point, lyrvolume: l or L, ml; gal, qt, pt, cup, floz, tbsp, tspmass: g, mg, kg, t; lb, oz, tontime: s or sec, ms, us, ns, min, hr, day, wktemperature: degC, degF, K

    1 2 3

  • 8/3/2019 calc_ref

    2/2

    GNU Calc Reference Card

    Programmers Functions

    binary, octal, hex display d 2, d 8, d 6decimal, other radix display d 0, d rdisplay leading zeros d zentering non-decimal numbers 16#7FFF

    binary word size b wbinary AND, OR, XOR b a, b o, b xbinary DIFF, NOT b d, b n

    left shift b llogical right shift b rarithmetic right shift b R

    integer quotient, remainder \, %integer square root, logarithm f Q, f Ifloor, ceiling, round to integer F, I F, R

    Variables

    Variable names are single digits or whole words.

    store to variable s tstore and keep on stack s srecall from variable s rshorthands for digit variables t n, s n, r nunstore, exchange variable s u, s xedit variable s e

    Vector Operations

    vector of 1, 2, . . . , n v x nvector of n counts from a by b C-u v xvector of copies of a value v bconcatenate into vector |pack many stack items into vector v punpack vector or object v u

    length of vector (list) v lreverse vector v vsort, grade vector V S, V Ghistogram of vector data V H

    extract vector element v rmatrix determinant, inverse V D, &matrix transpose, trace v t, V Tcross, dot products V C, *identity matrix v iextract matrix row, column v r, v c

    intersection, union, diff of sets V ^, V V, V -cardinality of set V #

    add vectors elementwise (i.e., map +) V M +sum elements in vector (i.e., reduce +) V R +sum rows in matrix V R _ +sum columns in matrix V R : +sum elements, accumulate results V U +

    Algebra

    enter an algebraic formula 2x+3y 2enter an equation 2x^2=18

    symbolic (vs. numeric) mode m sfractions (vs. float) mode m fsuppress evaluation of formulas m Osimplify formulas automatically m Sreturn to default evaluation rules m D

    Big display mode d BC, Pascal, FORTRAN modes d C, d P, d FTEX, eqn modes d T, d EUnformatted mode d UNormal language mode d N

    simplify formula a sput formula into rational form a nevaluate variables in formula =evaluate numerically Nlet variable equal a value in formula s l x=valdeclare properties of variable s d

    Common decls: pos, int, real, scalar, [a..b].

    expand, collect terms a x, a cfactor, partial fractions a f, a apolynomial quotient, remainder, GCD a \, a %, a gderivative, integral a d, a itaylor series a t

    principal solution to equation(s) a Slist of solutions a Pgeneric solution H a Sapply function to both sides of eqn a M

    rewrite formula a rExample: a r a*b + a*c := a*(b+c)Example: a r sin(x)^2 := 1-cos(x)^2Example: a r cos(n pi) := 1 :: integer(n) :: n%2 = 0Example: 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 a +product of formula over a range a *tabulate formula over a range a Tintegrate numerically over a range a Ifind zero of formula or equation a Rfind local min, max of formula a N, a Xfit data to line or curve a F

    mean of data in vector or variable u Mmedian of data H u Mgeometric mean of data u Gsum, product of data u +, u *minimum, maximum of data u N, u Xsample, pop. standard deviation u S, I u S

    Selections

    select subformula under cursor j sselect nth subformula j nselect more j munselect this, all formulas j u, j c

    copy indicated subformula j RETdelete indicated subformula j DEL

    commute selected terms j Ccommute term leftward, rightward j L, j Rdistribute, merge selection j D, j Misolate selected term in equation j Inegate, invert term in context j N, j &rewrite selected term j r

    Graphics

    graph function or data g fgraph 3D function or data g Freplot current graph g pprint current graph g Padd curve to graph g aset number of data points g Nset line, point styles g s, g Sset log vs. linear x, y axis g l, g Lset range for x, y axis g r, g R

    close graphics window g q

    Programming

    begin, end recording a macro C-x (, C-x )replay keyboard macro Xread region as written-out macro M-# mif, else, endif Z [, Z :, Z ]equal to, less than, member of a =, a