Package sage :: Package rings :: Module complex_double
[hide private]
[frames] | no frames]

Module complex_double



File: sage/rings/complex_double.pyx (starting at line 1)

Double Precision Complex Numbers

SAGE supports arithmetic using double-precision complex numbers.  A
double-precision complex number is a complex number x + I*y with x, y
64-bit (8 byte) floating point numbers (double precision).

The field \code{ComplexDoubleField} implements the field of all
double-precision complex numbers.  You can refer to this field by the
shorthand CDF.  Elements of this field are of type
\code{ComplexDoubleElement}.  If x and y are coercible to doubles, you
can create a complex double element using
\code{ComplexDoubleElement(x,y)}. You can coerce more general objects
z to complex doubles by typing either \code{ComplexDoubleField(x)} or
\code{CDF(x)}.

EXAMPLES:
    sage: ComplexDoubleField()
    Complex Double Field
    sage: CDF
    Complex Double Field
    sage: type(CDF.0)
    <type 'sage.rings.complex_double.ComplexDoubleElement'>
    sage: ComplexDoubleElement(sqrt(2),3)
    1.41421356237 + 3.0*I
    sage: parent(CDF(-2))
    Complex Double Field

    sage: CC == CDF
    False
    sage: CDF is ComplexDoubleField()     # CDF is the shorthand
    True
    sage: CDF == ComplexDoubleField()
    True
    

The underlying arithmetic of complex numbers is implemented using
functions and macros in GSL (the GNU Scientific Library), and should
be very fast.  Also, all standard complex trig functions, log,
exponents, etc., are implemented using GSL, and are also robust and
fast.  Several other special functions, e.g. eta, gamma, incomplete
gamma, etc., are implemented using the PARI C library.

AUTHOR:
    -- William Stein (2006-09): first version



Classes [hide private]
  ComplexDoubleElement
File: sage/rings/complex_double.pyx (starting at line 478) An approximation to a complex number using double precision floating point numbers.
  ComplexDoubleField_class
File: sage/rings/complex_double.pyx (starting at line 117) An approximation to the field of complex numbers using double precision floating point numbers.
  FloatToCDF
File: sage/rings/complex_double.pyx (starting at line 1741) Fast morphism from anything with a __float__ method to an RDF element.
Functions [hide private]
 
ComplexDoubleField(...)
File: sage/rings/complex_double.pyx (starting at line 1817) Returns the field of double precision complex numbers.
 
is_ComplexDoubleElement(...)
File: sage/rings/complex_double.pyx (starting at line 466) Return True if x is a is_ComplexDoubleElement.
 
is_ComplexDoubleField(...)
File: sage/rings/complex_double.pyx (starting at line 104) Return True if x is the complex double field.
Variables [hide private]
  CC = Complex Field with 53 bits of precision
  CDF = Complex Double Field
  RDF = Real Double Field
  RR = Real Field with 53 bits of precision
  __pyx_capi__ = {'new_ComplexDoubleElement': <PyCObject object ...
Function Details [hide private]

ComplexDoubleField(...)

 
File: sage/rings/complex_double.pyx (starting at line 1817)

Returns the field of double precision complex numbers.

EXAMPLE:
    sage: ComplexDoubleField()
    Complex Double Field
    sage: ComplexDoubleField() is CDF
    True    

is_ComplexDoubleElement(...)

 
File: sage/rings/complex_double.pyx (starting at line 466)

Return True if x is a is_ComplexDoubleElement.

EXAMPLES: 
    sage: is_ComplexDoubleElement(0)
    False
    sage: is_ComplexDoubleElement(CDF(0))
    True

is_ComplexDoubleField(...)

 
File: sage/rings/complex_double.pyx (starting at line 104)

Return True if x is the complex double field. 

EXAMPLE:
    sage: from sage.rings.complex_double import is_ComplexDoubleField
    sage: is_ComplexDoubleField(CDF)
    True
    sage: is_ComplexDoubleField(ComplexField(53))
    False


Variables Details [hide private]

__pyx_capi__

Value:
{'new_ComplexDoubleElement': <PyCObject object at 0xfea170>}