Package sage :: Package rings :: Module real_number :: Class RealNumber_mpf
[show private | hide private]
[frames | no frames]

Type RealNumber_mpf

object --+        
         |        
   Element --+    
             |    
    RealNumber --+
                 |
                RealNumber_mpf


A real number with a fixed number of bits of precision.

Create a number using
     RealNumber_mpf(value, bits=0)

INPUT:
    value -- a float, integer, or string
    prec -- an int, lower bound on the number of bits of precision
            (always >= 64).
EXAMPLES:
    >>> R = real_number.RealNumber_mpf
    >>> x = R(1.234); y = R(-1.1)
    >>> x < y
    False
    >>> x > y
    True
    >>> x + y
    0.133999999999999896971
    >>> x - y
    2.33400000000000007461
    >>> x * y
    -1.35740000000000009397
    >>> x / y
    -1.12181818181818171468
    >>> x*100
    123.399999999999998579
    >>> x**100
    1.35367986679107295756e9
    >>> 2*x
    2.46799999999999997158
    >>> x*2.0
    2.46799999999999997158
    >>> x.order()
    Infinity
    >>> x.prec()
    64
    >>> float(x)
    1.234
    >>> int(y)
    -1

Method Summary
  __init__(self, value, prec)
  prec(self)
  sign(self)
  sqrt(self)
    Inherited from RealNumber
  __abs__(self)
  __add__(self, right)
Return self + right.
  __cmp__(self, other)
Compare self and other.
  __div__(self, right)
Return the quotient self / right.
  __float__(self)
Return the coercion of self to a Python float.
  __int__(self)
Return the coercion of self to a Python int.
  __invert__(self)
Return the inverse of self.
  __long__(self)
Return the coercion of self to a Python long.
  __mul__(self, right)
Return the product of self and right.
  __neg__(self)
Return the negative of self.
  __pos__(self)
  __pow__(self, right)
  __radd__(self, left)
  __rdiv__(self, left)
  __repr__(self)
  __rmul__(self, left)
  __rsub__(self, left)
  __sub__(self, right)
  algebraic_dependence(self, n, flag)
Try to find a polynomial of degree at most n having this real number x as an approximate root.
  arg(self)
  imag(self)
  log(self)
Return the logarithm of self.
  order(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)

Property Summary
    Inherited from RealNumber
  pari_object: PARI real associated to this real number

Generated by Epydoc 2.1 on Mon Jun 20 15:43:22 2005 http://epydoc.sf.net