{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

PARIrefcard - PARI-GP Reference Card(PARI-GP version 2.2.5...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
PARI-GP Reference Card (PARI-GP version 2.2.5) Note: optional arguments are surrounded by braces {} . Starting & Stopping GP to enter GP, just type its name: gp to exit GP, type \q or quit Help describe function ? function extended description ?? keyword list of relevant help topics ??? pattern Input/Output & Defaults output previous line, the lines before % , %‘ , %‘‘ , etc. output from line n % n separate multiple statements on line ; extend statement on additional lines \ extend statements on several lines { seq 1 ; seq 2 ;} comment /* . . . */ one-line comment, rest of line ignored \\ . . . set default d to val default ( { d } , { val } , { fl } ) mimic behaviour of GP 1.39 default(compatible,3) Metacommands toggle timer on/off # print time for last result ## print % n in raw format \a n print % n in pretty format \b n print defaults \d set debug level to n \g n set memory debug level to n \gm n enable/disable logfile \l { filename } print % n in pretty matrix format \m set output mode (raw, default, prettyprint) \o n set n significant digits \p n set n terms in series \ps n quit GP \q print the list of PARI types \t print the list of user-defined functions \u read file into GP \r filename write % n to file \w n filename GP Within Emacs to enter GP from within Emacs: M-x gp , C-u M-x gp word completion TAB help menu window M-\c describe function M-? display T E X’d PARI manual M-x gpman set prompt string M-\p break line at column 100, insert \ M-\\ PARI metacommand \ letter M-\ letter Reserved Variable Names π = 3 . 14159 · · · Pi Euler’s constant = . 57721 · · · Euler square root of - 1 I big-oh notation O c 2003 Karim Belabas. Permissions on back. v2.16 PARI Types & Input Formats t INT . Integers ± n t REAL . Real Numbers ± n.ddd t INTMOD . Integers modulo m Mod ( n, m ) t FRAC . Rational Numbers n/m t COMPLEX . Complex Numbers x + y * I t PADIC . p -adic Numbers x + O ( p ^ k ) t QUAD . Quadratic Numbers x + y * quadgen ( D ) t POLMOD . Polynomials modulo g Mod ( f, g ) t POL . Polynomials a * x ^ n + · · · + b t SER . Power Series f + O ( x ^ k ) t QFI / t QFR . Imag/Real bin. quad. forms Qfb ( a, b, c, { d } ) t RFRAC . Rational Functions f/g t VEC / t COL . Row/Column Vectors [ x, y, z ] , [ x, y, z ] ~ t MAT . Matrices [ x, y ; z, t ; u, v ] t LIST . Lists List ( [ x, y, z ] ) t STR . Strings "aaa" Standard Operators basic operations + , - , * , / , ^ i=i+1 , i=i-1 , i=i*j , . . . i++ , i-- , i*=j , . . . euclidean quotient, remainder x \/ y , x \ y , x % y , divrem ( x, y ) shift x left or right n bits x << n , x >> n or shift ( x, n ) comparison operators <= , < , >= , > , == , != boolean operators (or, and, not) || , && , ! sign of x = - 1 , 0 , 1 sign ( x ) maximum/minimum of x and y max , min ( x, y ) integer or real factorial of x x ! or fact ( x ) derivative of f w.r.t. x f Conversions Change Objects make x a vector, matrix, set, list, string Vec , Mat , Set , List , Str create PARI object ( x mod y ) Mod ( x, y ) make x a polynomial of v Pol ( x, { v } ) as above, starting with constant term Polrev ( x, { v } ) make x a power series of v Ser ( x, { v } ) PARI type of object x type ( x, { t } ) object x with precision n prec ( x, { n } ) evaluate f replacing vars by their value eval ( f ) Select Pieces of an Object length of x # x or length ( x ) n -th component of x component ( x, n ) n -th component of vector/list x x [ n ] ( m, n )-th component of matrix x x [ m, n ] row m or column n of matrix x x [ m, ] , x [ , n ] numerator of x numerator ( x ) lowest denominator of
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}