| Home | Trees | Indices | Help |
|---|
|
|
File: sage/rings/complex_number.pyx (starting at line 1)
Arbitrary Precision Complex Numbers
AUTHOR:
-- William Stein (2006-01-26): complete rewrite
-- Joel B. Mohler (2006-12-16): naive rewrite into pyrex
-- William Stein(2007-01): rewrite of Mohler's rewrite
|
|||
|
ComplexNumber File: sage/rings/complex_number.pyx (starting at line 67) A floating point approximation to a complex number using any specified precision. |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
File: sage/rings/complex_number.pyx (starting at line 1317)
Return the complex number defined by the strings s_real and s_imag as an element of
\code{ComplexField(prec=n)}, where n potentially has slightly more
(controlled by pad) bits than given by s.
INPUT:
s_real -- a string that defines a real number (or something whose
string representation defines a number)
s_imag -- a string that defines a real number (or something whose
string representation defines a number)
pad -- an integer >= 0.
min_prec -- number will have at least this many bits of precision, no matter what.
EXAMPLES:
sage: ComplexNumber('2.3')
2.30000000000000
sage: ComplexNumber('2.3','1.1')
2.30000000000000 + 1.10000000000000*I
sage: ComplexNumber(10)
10.0000000000000
sage: ComplexNumber(10,10)
10.0000000000000 + 10.0000000000000*I
sage: ComplexNumber(1.000000000000000000000000000,2)
1.000000000000000000000000000 + 2.000000000000000000000000000*I
sage: ComplexNumber(1,2.000000000000000000000)
1.000000000000000000000 + 2.000000000000000000000*I
sage: sage.rings.complex_number.create_ComplexNumber(s_real=2,s_imag=1)
2.00000000000000 + 1.00000000000000*I
|
File: sage/rings/complex_number.pyx (starting at line 39)
Returns True if x is a complex number. In particular, if x is of the
\code{ComplexNumber} type.
EXAMPLES:
sage: a = ComplexNumber(1,2); a
1.00000000000000 + 2.00000000000000*I
sage: is_ComplexNumber(a)
True
sage: b = ComplexNumber(1); b
1.00000000000000
sage: is_ComplexNumber(b)
True
Note that the global element I is of type \code{SymbolicConstant}.
However, elements of the class \code{ComplexField_class} are of
type \code{ComplexNumber}:
sage: c = 1 + 2*I
sage: is_ComplexNumber(c)
False
sage: d = CC(1 + 2*I)
sage: is_ComplexNumber(d)
True
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Thu Jul 17 04:23:28 2008 | http://epydoc.sourceforge.net |