bridge/class-master/depend/pari/src/basemath/nffactor.c
/* assume leading term of P is an integer */
assume leading term of P is an integer
assume leading term of P is an integer
static GEN
RgX_int_normalize(GEN P)
{
  GEN P0 = leading_coeff(P);
  if (typ(P0) == t_POL)
  {
    P0 = gel(P0,2); 
    P = shallowcopy(P);
    gel(P,lg(P)-1) = P0; 
  }
  if (typ(P0) != t_INT) pari_err_BUG("RgX_int_normalize");
  if (is_pm1(P0)) return signe(P0) > 0? P: RgX_neg(P);
  return RgX_Rg_div(P, P0);
}
static GEN RgX_int_normalize ( GEN P ) { GEN P0 = leading_coeff ( P ) ; if ( typ ( P0 ) == t_POL ) { P0 = gel ( P0 , 2 ) ; P = shallowcopy ( P ) ; gel ( P , lg ( P ) - 1 ) = P0 ; } if ( typ ( P0 ) != t_INT ) pari_err_BUG ( " " ) ; if ( is_pm1 ( P0 ) ) return signe ( P0 ) > 0 ? P : RgX_neg ( P ) ; return RgX_Rg_div ( P , P0 ) ; }
assume leading term of P is an integer
assume leading term of P is an integer
/* cater for t_POL */ /* non-0 constant */ /* now leading term is a t_INT */