bridge/class-master/depend/pari/src/kernel/none/add.c
/* return gen_0 when the sign is 0 */
return gen_0 when the sign is 0
return gen_0 when the sign is 0
GEN
addii_sign(GEN x, long sx, GEN y, long sy)
{
  long lx,ly;
  GEN z;
  if (!sx) return sy? icopy_sign(y, sy): gen_0;
  if (!sy) return icopy_sign(x, sx);
  lx = lgefint(x);
  ly = lgefint(y);
  if (sx==sy)
    z = addiispec(x+2,y+2,lx-2,ly-2);
  else
  { 
    long i = cmpiispec(x+2,y+2,lx-2,ly-2);
    if (!i) return gen_0;
    if (i < 0) {
      sx = sy;
      z = subiispec(y+2,x+2,ly-2,lx-2);
    }
    else
      z = subiispec(x+2,y+2,lx-2,ly-2);
  }
  setsigne(z,sx); return z;
}
GEN addii_sign ( GEN x , long sx , GEN y , long sy ) { long lx , ly ; GEN z ; if ( ! sx ) return sy ? icopy_sign ( y , sy ) : gen_0 ; if ( ! sy ) return icopy_sign ( x , sx ) ; lx = lgefint ( x ) ; ly = lgefint ( y ) ; if ( sx == sy ) z = addiispec ( x + 2 , y + 2 , lx - 2 , ly - 2 ) ; else { long i = cmpiispec ( x + 2 , y + 2 , lx - 2 , ly - 2 ) ; if ( ! i ) return gen_0 ; if ( i < 0 ) { sx = sy ; z = subiispec ( y + 2 , x + 2 , ly - 2 , lx - 2 ) ; } else z = subiispec ( x + 2 , y + 2 , lx - 2 , ly - 2 ) ; } setsigne ( z , sx ) ; return z ; }
return gen_0 when the sign is 0
return gen_0 when the sign is 0
/* sx != sy */ /* we must ensure |x| > |y| for subiispec */