Home | Trees | Index | Help |
|
---|
Module decimal :: Class Decimal |
|
object
--+
|
Decimal
currency
Method Summary | |
---|---|
Return the adjusted exponent of self | |
Represents the number as a triple tuple. | |
Compares one to another. | |
Returns the larger value. | |
Returns the smaller value. | |
Normalize- strip trailing 0s, change anything equal to 0 to 0e0 | |
Quantize self so its exponent is the same as that of exp. | |
Remainder nearest to 0- abs(remainder-near) <= other/2 | |
Test whether self and other have the same exponent. | |
Return the square root of self. | |
Convert to engineering-type string. | |
Rounds to the nearest integer, without raising inexact, rounded. |
Instance Method Details |
---|
adjusted(self)Return the adjusted exponent of self |
as_tuple(self)Represents the number as a triple tuple. To show the internals exactly as they are. |
compare(self, other, context=None)Compares one to another. -1 => a < b 0 => a = b 1 => a > b NaN => one is NaN Like __cmp__, but returns Decimal instances. |
max(self, other, context=None)Returns the larger value. like max(self, other) except if one is not a number, returns NaN (and signals if one is sNaN). Also rounds. |
min(self, other, context=None)Returns the smaller value. like min(self, other) except if one is not a number, returns NaN (and signals if one is sNaN). Also rounds. |
normalize(self, context=None)Normalize- strip trailing 0s, change anything equal to 0 to 0e0 |
quantize(self, exp, rounding=None, context=None, watchexp=1)Quantize self so its exponent is the same as that of exp. Similar to self._rescale(exp._exp) but with error checking. |
remainder_near(self, other, context=None)Remainder nearest to 0- abs(remainder-near) <= other/2 |
same_quantum(self, other)Test whether self and other have the same exponent. same as self._exp == other._exp, except NaN == sNaN |
sqrt(self, context=None)Return the square root of self. Uses a converging algorithm (Xn+1 = 0.5*(Xn + self / Xn)) Should quadratically approach the right answer. |
to_eng_string(self, context=None)Convert to engineering-type string. Engineering notation has an exponent which is a multiple of 3, so there are up to 3 digits left of the decimal place. Same rules for when in exponential and when as a value as in __str__. |
to_integral(self, rounding=None, context=None)Rounds to the nearest integer, without raising inexact, rounded. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Oct 19 03:18:14 2006 | http://epydoc.sf.net |