bridge/class-master/depend/pari/src/modules/krasner.c
/* Eval P(x) assuming P has positive coefficients and the result is a long */
Eval P(x) assuming P has positive coefficients and the result is a long
Eval P ( x ) assuming P has positive coefficients and the result is a long
static ulong
ZX_z_eval(GEN P, ulong x)
{
  long i, l = lg(P);
  ulong z;
  if (typ(P) == t_INT) return itou(P);
  if (l == 2) return 0;
  z = itou(gel(P, l-1));
  for (i = l-2; i > 1; i--) z = z*x + itou(gel(P,i));
  return z;
}
static ulong ZX_z_eval ( GEN P , ulong x ) { long i , l = lg ( P ) ; ulong z ; if ( typ ( P ) == t_INT ) return itou ( P ) ; if ( l == 2 ) return 0 ; z = itou ( gel ( P , l - 1 ) ) ; for ( i = l - 2 ; i > 1 ; i -- ) z = z * x + itou ( gel ( P , i ) ) ; return z ; }
Eval P(x) assuming P has positive coefficients and the result is a long
Eval P ( x ) assuming P has positive coefficients and the result is a long