bridge/class-master/depend/pari/src/basemath/base3.c
/* Assume nf is a genuine nf. */
Assume nf is a genuine nf.
Assume nf is a genuine nf .
GEN
nf_to_scalar_or_basis(GEN nf, GEN x)
{
  switch(typ(x))
  {
    case t_INT: case t_FRAC:
      return x;
    case t_POLMOD:
      x = checknfelt_mod(nf,x,"nf_to_scalar_or_basis");
      switch(typ(x))
      {
        case t_INT: case t_FRAC: return x;
        case t_POL: return pol_to_scalar_or_basis(nf,x);
      }
      break;
    case t_POL: return pol_to_scalar_or_basis(nf,x);
    case t_COL:
      if (lg(x)-1 != nf_get_degree(nf)) break;
      return QV_isscalar(x)? gel(x,1): x;
  }
  pari_err_TYPE("nf_to_scalar_or_basis",x);
  return NULL; 
}
GEN nf_to_scalar_or_basis ( GEN nf , GEN x ) { switch ( typ ( x ) ) { case t_INT : case t_FRAC : return x ; case t_POLMOD : x = checknfelt_mod ( nf , x , " " ) ; switch ( typ ( x ) ) { case t_INT : case t_FRAC : return x ; case t_POL : return pol_to_scalar_or_basis ( nf , x ) ; } break ; case t_POL : return pol_to_scalar_or_basis ( nf , x ) ; case t_COL : if ( lg ( x ) - 1 != nf_get_degree ( nf ) ) break ; return QV_isscalar ( x ) ? gel ( x , 1 ) : x ; } pari_err_TYPE ( " " , x ) ; return NULL ; }
Assume nf is a genuine nf.
Assume nf is a genuine nf .
/* LCOV_EXCL_LINE */