bridge/class-master/depend/pari/src/basemath/base3.c
/* quotient of x and y in nf */
quotient of x and y in nf
quotient of x and y in nf
GEN
nfdiv(GEN nf, GEN x, GEN y)
{
  pari_sp av = avma;
  GEN z;
  nf = checknf(nf);
  y = nf_to_scalar_or_basis(nf, y);
  if (typ(y) != t_COL)
  {
    x = nf_to_scalar_or_basis(nf, x);
    z = (typ(x) == t_COL)? RgC_Rg_div(x, y): gdiv(x,y);
  }
  else
  {
    GEN d;
    y = Q_remove_denom(y, &d);
    z = nfmul(nf, x, zk_inv(nf,y));
    if (d) z = RgC_Rg_mul(z, d);
  }
  return gerepileupto(av, z);
}
GEN nfdiv ( GEN nf , GEN x , GEN y ) { pari_sp av = avma ; GEN z ; nf = checknf ( nf ) ; y = nf_to_scalar_or_basis ( nf , y ) ; if ( typ ( y ) != t_COL ) { x = nf_to_scalar_or_basis ( nf , x ) ; z = ( typ ( x ) == t_COL ) ? RgC_Rg_div ( x , y ) : gdiv ( x , y ) ; } else { GEN d ; y = Q_remove_denom ( y , & d ) ; z = nfmul ( nf , x , zk_inv ( nf , y ) ) ; if ( d ) z = RgC_Rg_mul ( z , d ) ; } return gerepileupto ( av , z ) ; }
quotient of x and y in nf
quotient of x and y in nf