Dirk Laurie on Thu, 14 Jun 2012 20:22:49 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

gp_read_str


I'm programming in library mode, and have some GEN's around that
never were assigned to anything in a `gp_read_str` call.  I now want
to make such a call involving some of these GEN's, and find it hard
to get `gp_read_str` to see those GEN's. In the following minimal
example, I'm trying and failing to assign an expression to variable `b`.

-----
#include <pari/pari.h>

int main() {
   pari_init(1000000,0);
   GEN x = pol_x[fetch_user_var("x")];
   pol_x[fetch_user_var("b")] = gaddsg(1, x);
   pariprintf("%Z\n",pol_x[fetch_user_var("b")]);  // prints x+1
   pariprintf("%Z\n",gp_read_str("b+10"));  // prints b+10, not x+11
}
-----