1GP(1) General Commands Manual GP(1)
2
3
4
6 gp - The PARI calculator
7
9 gp [-s stacksize] [-p primelimit] [--emacs] [-f|--fast] [-q|--quiet]
10 [-D|--default key=val] [--help] [--test] [--texmacs] [--version]
11 [--version-short] [ file1 file2 ...]
12
13
15 Invokes the PARI-GP calculator gp; gp is an advanced programmable cal‐
16 culator, specializing in number theory, which computes symbolically as
17 long as possible, numerically where needed, and contains a wealth of
18 arithmetic functions: factorizations, elliptic curves, Galois theory,
19 class field theory, modular forms, etc. Commands, written in the GP
20 scripting language, are input interactively or loaded from files.
21
22 If present at the end of the command line, files 'file1', 'file2', ...
23 are loaded on startup; they must be written in the GP language.
24
25
27 Command line options are available in both short form (-f) and POSIX-
28 like (--fast). Numeric arguments can be followed by a modifier k , M or
29 G at the user's convenience; in that case the argument is multiplied by
30 10^3, 10^6, or 10^9 respectively.
31
32
33 -f, --fast
34 Fast start (or factory settings). Do not read .gprc (see below)
35 upon startup.
36
37 -p limit
38 [DEPRECATED] Upon startup, gp computes a table of small primes
39 used in number-theoretic applications. If primelimit is set, the
40 table include primes up to that bound instead of the default (=
41 500000). It is now mostly useless to change this value.
42
43 -q, --quiet
44 Quiet mode. Do not print headers or history numbers and do not
45 say goodbye.
46
47
48 -D, --default key=val
49 performs default(key, val); on startup, overriding values from
50 the gprc preferences file. 'val' must be a constant value and is
51 not allowed to involve any computation (e.g. 1+1 is forbidden).
52 Any number of such default-setting statements may appear on the
53 command line. A key may be set multiple times, the last setting
54 taking precedence
55
56
57 -s limit
58 Size of gp internal stack allocated on startup. When gp runs out
59 of space, it interrupts the current computation and raises a
60 stack overflow exception. If this occurs frequently, start with
61 a bigger stack. The stack size can also be increased from within
62 gp, using default(parisize,limit); it may be convenient to set
63 stacksize from your .gprc. Note that computations with a
64 smaller stack may be more efficient due to better data locality.
65 Most computations should need less than 20MB.
66
67
68 --emacs
69 gp can be run in an Emacs shell (see GP User's manual for
70 details). This flag is then required for smooth interaction with
71 the PariEmacs package (pari.el). It is set automatically by the
72 pari.el package, and will produce display oddities if you set it
73 outside of an Emacs session.
74
75 --help print a summary of available command-line options.
76
77 --test run gp in test mode: suppress printing of history numbers and
78 wrap long output lines (to get readable diff output). For
79 benches only.
80
81 --texmacs
82 gp can be run from a TeXmacs frontend. This flag is set by TeX‐
83 macs, to enable special purpose communication channels. Do not
84 set it yourself.
85
86
87 --version
88 output version info (banner) then exit.
89
90
91 --version-short
92 output version number then exit.
93
94
96 ? to get online help.
97
98 ?? to get extended online help (more precisely, to call the exter‐
99 nal help program, gphelp by default)
100
101 quit (or \q), or EOF (Ctrl-D) to quit gp.
102
103 The following works only when gp was linked with GNU readline library:
104
105 arrow keys
106 for editing and viewing the input history.
107
108 TAB
109 for automatic completion
110
111
113 The following material is included in the standard distribution (origi‐
114 nally in TeX format) and can also be downloaded at
115 http://pari.math.u-bordeaux.fr/doc.html
116
117
118 The User's Guide to PARI/GP
119 (users.dvi)
120
121 The User's Guide to the PARI library
122 (library.dvi)
123
124 The Developer's Guide to the PARI library
125 (develop.dvi)
126
127 PARI/GP, a tutorial
128 (tutorial.dvi)
129
130 PARI/GP reference cards
131 (refcard*.dvi)
132
133
135 gp main executable
136
137 $HOME/.gprc
138 (or $GPRC if set) user preference file, read at beginning of
139 execution by each gp shell. A default gprc gprc.dft is provided
140 with the distribution. If this file cannot be found, /etc/gprc
141 is checked instead.
142
143
144 <logfile>
145 a file used to log in all commands and results; default:
146 pari.log (you need to set the log default in your gprc or inter‐
147 actively)
148
149
150 <psfile>
151 a file used to dump PostScript drawings; default: pari.ps
152
153
154 <histfile>
155 a file where gp will keep a history of all input commands (you
156 need to set the histfile default in the gprc file)
157
158
159 gphelp default external help program (as above)
160
161 *.gp GP programs
162
163
165 $GPRC place to look for the user's preference file (gprc); if the file
166 does not exist, we then check in $HOME/.gprc, /etc/gprc, and
167 finally for a file named 'gprc' in PARI's datadir.
168
169
170 $GP_DATA_DIR
171 directory containing data installed by optional PARI packages.
172 For example, the Galois resolvents files in directory galdata/
173 needed by the polgalois function, in degrees 8 to 11; or the
174 modular polynomials in seadata/ used by the ellap function for
175 large base fields. This environment variable overrides PARI's
176 'datadir', defined at Configure time.
177
178
179 $GP_POSTSCRIPT_VIEWER
180 an application able to display PostScript files, used by the
181 plotps graphic engine. This engine is a fallback used to output
182 hi-res plots even when no compatible graphical library was
183 available on your platform at Configure time. (Dumps the graph
184 to a temporary file, then open the file.)
185
186
187 $GP_SVG_VIEWER
188 an application able to display SGV images files, used by the
189 plotsvg graphic engine. This engine is a fallback used to output
190 hi-res plots even when no compatible graphical library was
191 available on your platform at Configure time. (Dumps the graph
192 to a temporary file, then open the file.)
193
194
195 $GPHELP
196 name of the external help program invoked by ?? and ??? short‐
197 cuts.
198
199
200 $GPTMPDIR
201 name of the directory where temporary files will be generated.
202
203
205 PARI's home page resides at
206 http://pari.math.u-bordeaux.fr/
207
208
210 There are a number of mailing lists devoted to the PARI/GP package, and
211 most feedback should be directed to those. See
212 http://pari.math.u-bordeaux.fr/lists-index.html
213 for details. The most important ones are:
214
215
216 - pari-announce (moderated): for us to announce major version changes.
217
218 - pari-dev: for everything related to the development of PARI, includ‐
219 ing suggestions, technical questions, bug reports or patch submissions.
220
221
222 - pari-users: for discuss about everything else, in particular ask for
223 help.
224
225 To subscribe, send empty messages with a Subject: containing the word
226 "subscribe" respectively to
227
228
229 pari-announce-request@pari.math.u-bordeaux.fr
230
231 pari-users-request@pari.math.u-bordeaux.fr
232
233 pari-dev-request@pari.math.u-bordeaux.fr
234
235
237 Bugs should be submitted online to our Bug Tracking System, available
238 from PARI's home page, or directly from the URL
239 http://pari.math.u-bordeaux.fr/Bugs/
240 Further instructions can be found on that page.
241
242
244 Despite the leading G, GP has nothing to do with GNU. The first version
245 was originally called GPC, for Great Programmable Calculator. For some
246 reason, the trailing C was eventually dropped.
247
248 PARI has nothing to do with the French capital. The name is a pun about
249 the project's early stages when the authors started to implement a
250 library for "Pascal ARIthmetic" in the PASCAL programming language.
251 They quickly switched to C.
252
253 For the benefit of non-native French speakers, here's a slightly
254 expanded explanation: Blaise Pascal (1623-1662) was a famous French
255 mathematician and philosopher who was one of the founders of probabil‐
256 ity and devised one of the first "arithmetic machines". He once pro‐
257 posed the following "proof" of the existence of God for the unbeliev‐
258 ers: whether He exists or not I lose nothing by believing in Him,
259 whereas if He does and I misbehave... This is the so-called "pari de
260 Pascal" (Pascal's Wager).
261
262 Note that PARI also means "fairy" in Persian.
263
264
266 PARI was originally written by Christian Batut, Dominique Bernardi,
267 Henri Cohen, and Michel Olivier in Laboratoire A2X (Universite Bordeaux
268 I, France), and was maintained by Henri Cohen up to version 1.39.15
269 (1995), and by Karim Belabas since then.
270
271 A great number of people have contributed to the successive improve‐
272 ments which eventually resulted in the present version. See the AUTHORS
273 file in the distribution.
274
275
277 gap(1), gphelp(1), perl(1), readline(3), sage(1), tex(1), texmacs(1),
278
279
281 This program is free software; you can redistribute it and/or modify it
282 under the terms of the GNU General Public License as published by the
283 Free Software Foundation.
284
285 This program is distributed in the hope that it will be useful, but
286 WITHOUT ANY WARRANTY; without even the implied warranty of MER‐
287 CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
288 Public License for more details.
289
290 You should have received a copy of the GNU General Public License along
291 with this program; if not, write to the Free Software Foundation, Inc.,
292 675 Mass Ave, Cambridge, MA 02139, USA.
293
294
295
296 11 September 2017 GP(1)