bridge/class-master/depend/pari/src/basemath/polarit3.c
/* If x is a POLMOD, assume modulus is a multiple of T. */
If x is a POLMOD, assume modulus is a multiple of T.
If x is a POLMOD assume modulus is a multiple of T .
GEN
Rg_to_FpXQ(GEN x, GEN T, GEN p)
{
  long ta, tx = typ(x), v = get_FpX_var(T);
  GEN a, b;
  if (is_const_t(tx))
  {
    if (tx == t_FFELT)
    {
      GEN z = FF_to_FpXQ(x);
      setvarn(z, v);
      return z;
    }
    return scalar_ZX(degpol(T)? Rg_to_Fp(x, p): gen_0, v);
  }
  switch(tx)
  {
    case t_POLMOD:
      b = gel(x,1);
      a = gel(x,2); ta = typ(a);
      if (is_const_t(ta))
        return scalar_ZX(degpol(T)? Rg_to_Fp(a, p): gen_0, v);
      b = RgX_to_FpX(b, p); if (varn(b) != v) break;
      a = RgX_to_FpX(a, p);
      if (ZX_equal(b,get_FpX_mod(T)) || signe(FpX_rem(b,T,p))==0)
        return FpX_rem(a, T, p);
      break;
    case t_POL:
      if (varn(x) != v) break;
      return FpX_rem(RgX_to_FpX(x,p), T, p);
    case t_RFRAC:
      a = Rg_to_FpXQ(gel(x,1), T,p);
      b = Rg_to_FpXQ(gel(x,2), T,p);
      return FpXQ_div(a,b, T,p);
  }
  pari_err_TYPE("Rg_to_FpXQ",x);
  return NULL; 
}
GEN Rg_to_FpXQ ( GEN x , GEN T , GEN p ) { long ta , tx = typ ( x ) , v = get_FpX_var ( T ) ; GEN a , b ; if ( is_const_t ( tx ) ) { if ( tx == t_FFELT ) { GEN z = FF_to_FpXQ ( x ) ; setvarn ( z , v ) ; return z ; } return scalar_ZX ( degpol ( T ) ? Rg_to_Fp ( x , p ) : gen_0 , v ) ; } switch ( tx ) { case t_POLMOD : b = gel ( x , 1 ) ; a = gel ( x , 2 ) ; ta = typ ( a ) ; if ( is_const_t ( ta ) ) return scalar_ZX ( degpol ( T ) ? Rg_to_Fp ( a , p ) : gen_0 , v ) ; b = RgX_to_FpX ( b , p ) ; if ( varn ( b ) != v ) break ; a = RgX_to_FpX ( a , p ) ; if ( ZX_equal ( b , get_FpX_mod ( T ) ) || signe ( FpX_rem ( b , T , p ) ) == 0 ) return FpX_rem ( a , T , p ) ; break ; case t_POL : if ( varn ( x ) != v ) break ; return FpX_rem ( RgX_to_FpX ( x , p ) , T , p ) ; case t_RFRAC : a = Rg_to_FpXQ ( gel ( x , 1 ) , T , p ) ; b = Rg_to_FpXQ ( gel ( x , 2 ) , T , p ) ; return FpXQ_div ( a , b , T , p ) ; } pari_err_TYPE ( " " , x ) ; return NULL ; }
If x is a POLMOD, assume modulus is a multiple of T.
If x is a POLMOD assume modulus is a multiple of T .
/* LCOV_EXCL_LINE */