bridge/class-master/depend/pari/src/basemath/Ser.c
/* conversion: prec ignored if t_VEC or t_SER in variable v */
prec ignored if t_VEC or t_SER in variable v
prec ignored if t_VEC or t_SER in variable v
GEN
gtoser(GEN x, long v, long prec)
{
  long tx = typ(x);
  if (v < 0) v = 0;
  if (prec < 0) pari_err_DOMAIN("Ser", "precision", "<", gen_0, stoi(prec));
  if (tx == t_SER)
  {
    long s = varncmp(varn(x), v);
    if      (s < 0) return coefstoser(x, v, prec);
    else if (s > 0) return scalarser(x, v, prec);
    return gcopy(x);
  }
  if (is_scalar_t(tx)) return scalarser(x,v,prec);
  switch(tx)
  {
    case t_POL: return poltoser(x, v, prec);
    case t_RFRAC: return rfractoser(x, v, prec);
    case t_QFR:
    case t_QFI: return RgV_to_ser_i(x, v, 4+1, 1);
    case t_VECSMALL: x = zv_to_ZV(x);
    case t_VEC: case t_COL:
      if (varncmp(gvar(x), v) <= 0) pari_err_PRIORITY("Ser", x, "<=", v);
      return RgV_to_ser_i(x, v, lg(x)+1, 1);
  }
  pari_err_TYPE("Ser",x);
  return NULL; 
}
GEN gtoser ( GEN x , long v , long prec ) { long tx = typ ( x ) ; if ( v < 0 ) v = 0 ; if ( prec < 0 ) pari_err_DOMAIN ( " " , " " , " " , gen_0 , stoi ( prec ) ) ; if ( tx == t_SER ) { long s = varncmp ( varn ( x ) , v ) ; if ( s < 0 ) return coefstoser ( x , v , prec ) ; else if ( s > 0 ) return scalarser ( x , v , prec ) ; return gcopy ( x ) ; } if ( is_scalar_t ( tx ) ) return scalarser ( x , v , prec ) ; switch ( tx ) { case t_POL : return poltoser ( x , v , prec ) ; case t_RFRAC : return rfractoser ( x , v , prec ) ; case t_QFR : case t_QFI : return RgV_to_ser_i ( x , v , 4 + 1 , 1 ) ; case t_VECSMALL : x = zv_to_ZV ( x ) ; case t_VEC : case t_COL : if ( varncmp ( gvar ( x ) , v ) <= 0 ) pari_err_PRIORITY ( " " , x , " " , v ) ; return RgV_to_ser_i ( x , v , lg ( x ) + 1 , 1 ) ; } pari_err_TYPE ( " " , x ) ; return NULL ; }
conversion: prec ignored if t_VEC or t_SER in variable v
conversion : prec ignored if t_VEC or t_SER in variable v
/*fall through*/ /* LCOV_EXCL_LINE */