20180914, 02:53  #265 
"Rashid Naimi"
Oct 2015
Remote to Here/There
2^{3}·3·79 Posts 
PARI/GP experts,
What is the correct reference term to the software? PARI, or PARI/GP? In particular how would you label a PARI/GP scripting code? Thank you for your time. 
20180914, 11:11  #266 
Jan 2008
France
1000010000_{2} Posts 
According to the official site: https://pari.math.ubordeaux.fr/
PARI is the name of the C library and GP the name of the scripting language. So I would say PARI/GP 
20180914, 11:47  #267 
"Rashid Naimi"
Oct 2015
Remote to Here/There
2^{3}×3×79 Posts 
Thank you for the clarification.

20180914, 13:02  #268 
Aug 2006
13441_{8} Posts 
To expand on ldesnogu's answer:
 If you write a script like this: Code:
forprime(p=2, 97, print(p)) Code:
#include <pari/pari.h> /* return d = gcd(a,b), sets u, v such that au + bv = gcd(a,b) */ GEN extgcd(GEN A, GEN B, GEN *U, GEN *V) { pari_sp av = avma; GEN ux = gen_1, vx = gen_0, a = A, b = B; if (typ(a) != t_INT) pari_err_TYPE("extgcd",a); if (typ(b) != t_INT) pari_err_TYPE("extgcd",b); if (signe(a) < 0) { a = negi(a); ux = negi(ux); } while (!gequal0(b)) { GEN r, q = dvmdii(a, b, &r), v = vx; vx = subii(ux, mulii(q, vx)); ux = v; a = b; b = r; } *U = ux; *V = diviiexact( subii(a, mulii(A,ux)), B ); gerepileall(av, 3, &a, U, V); return a; } int main() { GEN x, y, d, u, v; pari_init(1000000,2); printf("x = "); x = gp_read_stream(stdin); printf("y = "); y = gp_read_stream(stdin); d = extgcd(x, y, &u, &v); pari_printf("gcd = %Ps\nu = %Ps\nv = %Ps\n", d, u, v); pari_close(); return 0; } If you run a little calculator program and it says something like Code:
Reading GPRC: gprc.txt ...Done. GP/PARI CALCULATOR Version 2.12.0 (development 229432eb50d55b) amd64 running mingw (x8664/GMP6.1.2 kernel) 64bit version compiled: Aug 22 2018, gcc version 7.3win32 20180506 (GCC) threading engine: single (readline v6.2 enabled, extended help enabled) Copyright (C) 20002018 The PARI Group PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER. Type ? for help, \q to quit. Type ?17 for how to get moral (and possibly technical) support. parisizemax = 800000000, primelimit = 300000000 (Sep 14 08:59) gp > The combination of the library PARI, the scripting language GP, and the program gp is called "PARI/GP". Last fiddled with by CRGreathouse on 20180914 at 13:03 
20200806, 04:11  #269 
"Rashid Naimi"
Oct 2015
Remote to Here/There
2^{3}·3·79 Posts 
Hey Pari experts,
Is there a way to pass a small integer value to the Pari program in the command line. Something similar to what can be done in a batch file: https://www.tutorialspoint.com/batch..._variables.htm I am not looking for complex or large values here. Thanks in advance. 
20200806, 04:45  #270  
Sep 2002
Database er0rr
2^{6}·53 Posts 
Quote:
"GP exists in a REPL and so it doesn't make sense to parse commandline arguments. But PARI can parse them just like C" All I can think to do is to put your arguments in a file in vector form or one line per argument and have your script read or readvec them. Last fiddled with by paulunderwood on 20200806 at 05:00 

20200806, 05:08  #271 
"Rashid Naimi"
Oct 2015
Remote to Here/There
3550_{8} Posts 
Thanks for that Paul.
It doesn't make sense but would have been very useful if they allowed it anyway. I am trying to avoid having multiple files written for multiple instances. The closest I managed to get it to is to change the "TITLE" of the launching window and reading it in Pari with the system command. But the system command executes the command and returns 0 as the return value. A simple/primitive feature made absolutely impossible in such an advanced program. 
20200806, 05:28  #272 
Sep 2002
Database er0rr
2^{6}×53 Posts 
Code:
cat test.gp V=read("./myvec.txt"); for(v=1,#V,print(V[v])) Code:
echo "[1,2,3,4]" > myvec.txt; gp q < test.gp 1 2 3 4 Last fiddled with by paulunderwood on 20200806 at 05:28 
20200806, 13:45  #273 
Aug 2006
1721_{16} Posts 

20200815, 07:27  #274 
"Rashid Naimi"
Oct 2015
Remote to Here/There
2^{3}×3×79 Posts 
Good day experts,
foreach is present on this page https://pari.math.ubordeaux.fr/doch...tatements.html But I can't find it on Parigp How can I use it? Thanks n advance 
20200815, 12:23  #275  
Feb 2017
Nowhere
5×691 Posts 
Quote:
I don't know the earliest version of PariGP that included foreach(V, X, seq) but I did find it mentioned on a reference card for version 2.12.1. 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
An equivalent problem for factorization of large numbers  HellGauss  Math  5  20120412 14:01 
PIV Effective Equivalent curiosities...  petrw1  Software  0  20091205 04:41 
Dual Core P95 64Bit P4 Equivalent problem  g0ods  Software  9  20090915 14:12 
Is there a finitefield equivalent to the DWT?  fivemack  Math  4  20080327 17:58 
Equivalent code  dsouza123  Programming  25  20051008 05:10 