bridge/class-master/depend/pari/src/basemath/base2.c
/* return NULL if a mod f is not an integer
 * The denominator of any integer in Zp[X]/(f) divides pdr */
return NULL if a mod f is not an integer
The denominator of any integer in Zp[X]/(f) divides pdr
return NULL if a mod f is not an integer The denominator of any integer in Zp [ X ] / ( f ) divides pdr
static GEN
mycaract(decomp_t *S, GEN f, GEN a, GEN pp, GEN pdr)
{
  pari_sp av;
  GEN d, chi, prec1, prec2, prec3, ns;
  long vd, n = degpol(f);
  if (gequal0(a)) return pol_0(varn(f));
  a = QpX_remove_denom(a, S->p, &d, &vd);
  prec1 = pp;
  if (lgefint(S->p) == 3)
    prec1 = mulii(prec1, powiu(S->p, factorial_lval(n, itou(S->p))));
  if (d)
  {
    GEN p1 = powiu(d, n);
    prec2 = mulii(prec1, p1);
    prec3 = mulii(prec1, gmin_shallow(mulii(p1, d), pdr));
  }
  else
    prec2 = prec3 = prec1;
  manage_cache(S, f, prec3);
  av = avma;
  ns = newtonsums(S->p, a, d, vd, f, n, prec2, S->ns);
  if (!ns) return NULL;
  chi = newtoncharpoly(prec1, S->p, ns);
  if (!chi) return NULL;
  setvarn(chi, varn(f));
  return gerepileupto(av, centermod(chi, pp));
}
static GEN mycaract ( decomp_t * S , GEN f , GEN a , GEN pp , GEN pdr ) { pari_sp av ; GEN d , chi , prec1 , prec2 , prec3 , ns ; long vd , n = degpol ( f ) ; if ( gequal0 ( a ) ) return pol_0 ( varn ( f ) ) ; a = QpX_remove_denom ( a , S -> p , & d , & vd ) ; prec1 = pp ; if ( lgefint ( S -> p ) == 3 ) prec1 = mulii ( prec1 , powiu ( S -> p , factorial_lval ( n , itou ( S -> p ) ) ) ) ; if ( d ) { GEN p1 = powiu ( d , n ) ; prec2 = mulii ( prec1 , p1 ) ; prec3 = mulii ( prec1 , gmin_shallow ( mulii ( p1 , d ) , pdr ) ) ; } else prec2 = prec3 = prec1 ; manage_cache ( S , f , prec3 ) ; av = avma ; ns = newtonsums ( S -> p , a , d , vd , f , n , prec2 , S -> ns ) ; if ( ! ns ) return NULL ; chi = newtoncharpoly ( prec1 , S -> p , ns ) ; if ( ! chi ) return NULL ; setvarn ( chi , varn ( f ) ) ; return gerepileupto ( av , centermod ( chi , pp ) ) ; }
return NULL if a mod f is not an integer
 The denominator of any integer in Zp[X]/(f) divides pdr
return NULL if a mod f is not an integer The denominator of any integer in Zp [ X ] / ( f ) divides pdr