bridge/class-master/depend/pari/src/basemath/base2.c
/*******************************************************************/
/*                                                                 */
/*                       RELATIVE ROUND 2                          */
/*                                                                 */
/*******************************************************************/
/* Shallow functions */
/* FIXME: use a bb_field and export the nfX_* routines */
RELATIVE ROUND 2

Shallow functions
FIXME: use a bb_field and export the nfX_* routines
RELATIVE ROUND 2 Shallow functions FIXME : use a bb_field and export the nfX_ * routines
static GEN
nfX_sub(GEN nf, GEN x, GEN y)
{
  long i, lx = lg(x), ly = lg(y);
  GEN z;
  if (ly <= lx) {
    z = cgetg(lx,t_POL); z[1] = x[1];
    for (i=2; i < ly; i++) gel(z,i) = nfsub(nf,gel(x,i),gel(y,i));
    for (   ; i < lx; i++) gel(z,i) = gel(x,i);
    z = normalizepol_lg(z, lx);
  } else {
    z = cgetg(ly,t_POL); z[1] = y[1];
    for (i=2; i < lx; i++) gel(z,i) = nfsub(nf,gel(x,i),gel(y,i));
    for (   ; i < ly; i++) gel(z,i) = gneg(gel(y,i));
    z = normalizepol_lg(z, ly);
  }
  return z;
}
static GEN nfX_sub ( GEN nf , GEN x , GEN y ) { long i , lx = lg ( x ) , ly = lg ( y ) ; GEN z ; if ( ly <= lx ) { z = cgetg ( lx , t_POL ) ; z [ 1 ] = x [ 1 ] ; for ( i = 2 ; i < ly ; i ++ ) gel ( z , i ) = nfsub ( nf , gel ( x , i ) , gel ( y , i ) ) ; for ( ; i < lx ; i ++ ) gel ( z , i ) = gel ( x , i ) ; z = normalizepol_lg ( z , lx ) ; } else { z = cgetg ( ly , t_POL ) ; z [ 1 ] = y [ 1 ] ; for ( i = 2 ; i < lx ; i ++ ) gel ( z , i ) = nfsub ( nf , gel ( x , i ) , gel ( y , i ) ) ; for ( ; i < ly ; i ++ ) gel ( z , i ) = gneg ( gel ( y , i ) ) ; z = normalizepol_lg ( z , ly ) ; } return z ; }
RELATIVE ROUND 2
RELATIVE ROUND 2