Roland Dreier on Thu, 22 Oct 1998 11:05:11 -0500 (CDT)


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

Re: Explain this behavior?


On Thu, 22 Oct 1998, Jeremy Teitelbaum wrote:
> Dear pari users,
> can anyone explain this to me?  The variable l1 is computed
> in a function.   It contains a matrix with rational entries.
> THe command mathnf(l1) fails; however, typing "l1" followed
> by mathnf(%) works fine.

I have experienced similar behavior when values that looked like constants
are actually stored by gp as polynomials of degree 0.  Displaying the
value and then using % seems to change the type (I'm not sure why).  You
could investigate this by looking at  "type(l1[1,1])" versus
"type(%[1,1])".

If this is indeed the problem, the way around it is simply to evaluate
your constant polynomials.  Just use "subst(l1, variable, 0)" instead of
l1, where "variable" is the variable gp thinks the entries are polynomials
in.

Roland