Package sage :: Package rings :: Module complex_field :: Class ComplexField
[show private | hide private]
[frames | no frames]

Type ComplexField

      Ring --+
             |
object --+   |
         |   |
  _uniq_CC --+
             |
            ComplexField


The field of complex numbers.
    EXAMPLES:
    >>> C = ComplexField(); C
    Complex Field
    >>> C('1/3')
    0.333333333333333333333
    >>> C('1/3', 2)
    0.333333333333333333333 + 2.0*I
    
Note that the second argument is the number of *bits* of precision,
not the number of digits of precision:
    >>> C('1/3',2, 100)
    0.3333333333333333333333333333333333333333 + 2.0*I
    
We can also coerce rational numbers and integers into C, but
coercing a polynomial in raising an exception.
    >>> Q = RationalField()
    >>> C(Q('1/3'))
    0.333333333333333333333
    >>> C(Q('1/3'), Q('2/3'), 10)
    0.333333333333333333333 + 0.666666666666666666667*I
    >>> S = PolynomialRing(Q)
    >>> C(S.gen())
    Traceback (most recent call last):
    ...
    TypeError: unable to coerce (x,0) to a ComplexNumber
    >>> C.is_field()
    True
    >>> C.characteristic()
    0
    >>> C.name()
    'C'
    >>> C == C
    True
    >>> C == 1.1
    False

Method Summary
  __init__(self)
  __call__(self, re, im, bits)
  __repr__(self)
  characteristic(self)
  gen(self, n, bits)
  is_field(self)
  name(self)
  ngens(self)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)
    Inherited from Ring
  is_atomic_repr(self)
True if the elements have atomic string representations, in the sense that they print if they print at s, then -s means the negative of s.
  type(self)

Generated by Epydoc 2.1 on Mon May 9 17:57:02 2005 http://epydoc.sf.net