Package sage :: Package rings :: Module complex_number :: Class ComplexNumber
[show private | hide private]
[frames | no frames]

Type ComplexNumber

object --+    
         |    
   Element --+
             |
            ComplexNumber


A complex number.
Method Summary
  __init__(self, real, imag, prec)
  __abs__(self)
  __add__(self, right)
  __cmp__(self, other)
  __complex__(self)
  __div__(self, right)
  __float__(self)
  __int__(self)
  __invert__(self)
  __long__(self)
  __mul__(self, right)
  __neg__(self)
  __pos__(self)
  __pow__(self, right)
  __radd__(self, left)
  __rdiv__(self, left)
  __repr__(self)
  __rmul__(self, left)
  __rsub__(self, left)
  __sub__(self, right)
  arg(self)
Same as argument.
  argument(self)
The argument (angle) of the complex number, normalized so that -pi < arg <= pi.
  conjugate(self)
  exp(self, prec)
Compute exp(z) using Fourier series.
  imag(self)
  log(self)
Complex logarithm of z with branch chosen as follows: Write z = rho*exp(i*theta) with -pi <= theta < pi.
  norm(self)
  order(self)
  pari(self)
  prec(self)
  real(self)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

arg(self)

Same as argument.

argument(self)

The argument (angle) of the complex number, normalized so that -pi < arg <= pi.

WARNING: We use the floating point atan function, so there is precision loss.

exp(self, prec=None)

Compute exp(z) using Fourier series.

If prec is given, compute until the nth summand is less than 10^(-prec).

log(self)

Complex logarithm of z with branch chosen as follows:
Write z = rho*exp(i*theta) with -pi <= theta < pi.  Then
       log(z) = log(rho) + i*theta.

WARNING: Currently the real log is computed using floats, so there is
potential precision loss.

Generated by Epydoc 2.1 on Fri Jun 24 17:58:44 2005 http://epydoc.sf.net