bridge/class-master/depend/pari/src/basemath/trans3.c
/* return P mod x^n where P is polynomial in x */
return P mod x^n where P is polynomial in x
return P mod x^n where P is polynomial in x
static GEN
pol_mod_xn(GEN P, long n)
{
  long j, l = lg(P), N = n+2;
  GEN R;
  if (l > N) l = N;
  R = cgetg(N, t_POL); R[1] = evalvarn(0);
  for (j = 2; j < l; j++) gel(R,j) = gel(P,j);
  return normalizepol_lg(R, n+2);
}
static GEN pol_mod_xn ( GEN P , long n ) { long j , l = lg ( P ) , N = n + 2 ; GEN R ; if ( l > N ) l = N ; R = cgetg ( N , t_POL ) ; R [ 1 ] = evalvarn ( 0 ) ; for ( j = 2 ; j < l ; j ++ ) gel ( R , j ) = gel ( P , j ) ; return normalizepol_lg ( R , n + 2 ) ; }
return P mod x^n where P is polynomial in x
return P mod x^n where P is polynomial in x