bridge/class-master/depend/pari/src/basemath/base3.c
/* valuation of integral x (ZV), with resp. to prime ideal pr */
valuation of integral x (ZV), with resp. to prime ideal pr
valuation of integral x ( ZV ) with resp . to prime ideal pr
long
ZC_nfvalrem(GEN x, GEN pr, GEN *newx)
{
  long i, v, l;
  GEN r, y, p = pr_get_p(pr), mul = pr_get_tau(pr);
  if (typ(mul) == t_INT) return newx? ZV_pvalrem(x, p, newx):ZV_pval(x, p);
  y = cgetg_copy(x, &l); 
  x = leafcopy(x);
  for(v=0;; v++)
  {
    for (i=1; i<l; i++)
    { 
      gel(y,i) = dvmdii(ZMrow_ZC_mul(mul,x,i),p,&r);
      if (r != gen_0) { if (newx) *newx = x; return v; }
    }
    swap(x, y);
  }
}
long ZC_nfvalrem ( GEN x , GEN pr , GEN * newx ) { long i , v , l ; GEN r , y , p = pr_get_p ( pr ) , mul = pr_get_tau ( pr ) ; if ( typ ( mul ) == t_INT ) return newx ? ZV_pvalrem ( x , p , newx ) : ZV_pval ( x , p ) ; y = cgetg_copy ( x , & l ) ; x = leafcopy ( x ) ; for ( v = 0 ; ; v ++ ) { for ( i = 1 ; i < l ; i ++ ) { gel ( y , i ) = dvmdii ( ZMrow_ZC_mul ( mul , x , i ) , p , & r ) ; if ( r != gen_0 ) { if ( newx ) * newx = x ; return v ; } } swap ( x , y ) ; } }
valuation of integral x (ZV), with resp.
valuation of integral x ( ZV ) with resp .
/* p inert */ /* will hold the new x */ /* is (x.b)[i] divisible by p ? */