Home | Trees | Index | Help |
|
---|
Package sage :: Package rings :: Module complex_field :: Class 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 | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
Inherited from Ring | |
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. | |
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon May 9 17:57:02 2005 | http://epydoc.sf.net |