Dirk Laurie on Thu, 08 Aug 2013 20:10:09 +0200


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

Re: Variable checker


2013/8/7 Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>:

> My approach for this, would be to write a function
>
>   variables(expr)
...
>     for (i = 1, #v, L = setunion(L, variables(v[i])));

'setunion' is available in 2.5.1 too, but I can't get it to
obey me.

$ gp
Reading GPRC: /etc/gprc ...Done.

                 GP/PARI CALCULATOR Version 2.5.1 (released)
          i686 running linux (ix86/GMP-5.0.2 kernel) 32-bit version
       compiled: Aug  4 2013, gcc-4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
                (readline v6.2 enabled, extended help enabled)

                    Copyright (C) 2000-2011 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 ?12 for how to get moral (and possibly technical) support.

parisize = 4000000, primelimit = 500509
? setunion([x],[a])
  ***   at top-level: setunion([x],[a])
  ***                 ^-----------------
  *** setunion: incorrect type in comparison.
  ***   Break loop: type 'break' to go back to GP
break>

When I assign [x] and [a] to variables, then \x makes them
look exactly the same.