next up previous
Next: Type declaration Up: Advanced use of gp2c Previous: Advanced use of gp2c

gp2c types

Internally gp2c assign types to objects. The most common types are given below:

name description
void like in C
bool boolean, true (1) or false (0)
negbool antiboolean, true (0) or false (1)
small C integer long
int multiprecision integer
real multiprecision floating point
mp multiprecision number
var variable
pol polynomial
vecsmall vector of C long (t_VECSMALL)
vec vector and matrices (excluding vecsmall)
list GP lists
str characters string as a char *
genstr characters string as a GEN (t_STR)
gen generic PARI object (GEN)
lg length of object (returned by length)
typ type of object (returned by type)


Table 1: Types preorder
\begin{table}\begin{displaymath}
\unitlength=1.mm
\begin{picture}(12,50)(-6,0)
\...
...ine(1,4){7}}
\put(0,04){\line(0,1){5}}
\end{picture}\end{displaymath}\end{table}


Types are preordered as in Table 1. The complete preorder known by gp2c can be accessed by running 'gp2c -t'.

Variable are typed. A variable can only take values having a type equal or lower than its type. By default, variables are of type gen.


next up previous
Next: Type declaration Up: Advanced use of gp2c Previous: Advanced use of gp2c
Bill Allombert 2006-01-28