Home | Trees | Index | Help |
|
---|
Package sage :: Package rings :: Module real_number :: Class RealNumber_decimal |
|
object
--+ |Element
--+ |RealNumber
--+ | RealNumber_decimal
A real number with an arbitrary number of bits of precision. This is implemented using the builtin Python Decimal type. Create a number using RealNumber_decimal(value,) INPUT: value -- a float, integer, or string EXAMPLES: >>> R = real_number.RealNumber_decimal >>> R(1.32) 1.32 >>> R('2/3') 0.6666666666666666666666666667 >>> x = R(1.234); y = R(-1.1) >>> x < y False >>> x > y True >>> x + y 0.134 >>> x - y 2.334 >>> x * y -1.3574 >>> x / y -1.121818181818181818181818182 >>> x*100 123.400 >>> x**100 1353679866.791074518495392801 >>> 2*x 2.468 >>> x*2.0 2.4680 >>> x.order() Infinity >>> x.prec() Infinity >>> float(x) 1.234 >>> int(y) -1
Method Summary | |
---|---|
__init__(self,
value)
| |
prec(self)
| |
Inherited from RealNumber | |
| |
Return self + right. | |
Compare self and other. | |
Return the quotient self / right. | |
Return the coercion of self to a Python float. | |
Return the coercion of self to a Python int. | |
Return the inverse of self. | |
Return the coercion of self to a Python long. | |
Return the product of self and right. | |
Return the negative of self. | |
| |
| |
| |
| |
| |
| |
| |
| |
Try to find a polynomial of degree at most n having this real number x as an approximate root. | |
| |
| |
Return the logarithm of self. | |
| |
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Property Summary | |
---|---|
Inherited from RealNumber | |
pari_object : PARI real associated to this real number |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Fri Jun 24 17:58:46 2005 | http://epydoc.sf.net |