bridge/class-master/depend/pari/src/basemath/trans2.c
/* we know that x and y are not both 0 */
we know that x and y are not both 0
we know that x and y are not both 0
static GEN
mparg(GEN x, GEN y)
{
  long prec, sx = signe(x), sy = signe(y);
  GEN z;
  if (!sy)
  {
    if (sx > 0) return real_0_bit(expo(y) - expo(x));
    return mppi(realprec(x));
  }
  prec = realprec(y); if (prec < realprec(x)) prec = realprec(x);
  if (!sx)
  {
    z = Pi2n(-1, prec); if (sy < 0) setsigne(z,-1);
    return z;
  }
  if (expo(x)-expo(y) > -2)
  {
    z = mpatan(divrr(y,x)); if (sx > 0) return z;
    return addrr_sign(z, signe(z), mppi(prec), sy);
  }
  z = mpatan(divrr(x,y));
  return addrr_sign(z, -signe(z), Pi2n(-1, prec), sy);
}
static GEN mparg ( GEN x , GEN y ) { long prec , sx = signe ( x ) , sy = signe ( y ) ; GEN z ; if ( ! sy ) { if ( sx > 0 ) return real_0_bit ( expo ( y ) - expo ( x ) ) ; return mppi ( realprec ( x ) ) ; } prec = realprec ( y ) ; if ( prec < realprec ( x ) ) prec = realprec ( x ) ; if ( ! sx ) { z = Pi2n ( -1 , prec ) ; if ( sy < 0 ) setsigne ( z , -1 ) ; return z ; } if ( expo ( x ) - expo ( y ) > -2 ) { z = mpatan ( divrr ( y , x ) ) ; if ( sx > 0 ) return z ; return addrr_sign ( z , signe ( z ) , mppi ( prec ) , sy ) ; } z = mpatan ( divrr ( x , y ) ) ; return addrr_sign ( z , - signe ( z ) , Pi2n ( -1 , prec ) , sy ) ; }
we know that x and y are not both 0
we know that x and y are not both 0