Lines Matching full:exponent
145 DecimalTuple = _namedtuple('DecimalTuple', 'sign digits exponent')
185 """Exponent of a 0 changed to fit bounds.
187 This occurs and signals clamped if the exponent of a result has been
189 representation. This may occur when the exponent of a zero result would
191 number would have an encoded exponent that cannot be represented. In
192 this latter case, the exponent is reduced to fit and the corresponding
312 """Exponent < Emin before rounding.
315 operation is subnormal (that is, its adjusted exponent is less than
325 This occurs and signals overflow if the adjusted exponent of a result
364 adjusted exponent of the result would be smaller (more negative) than
369 necessary, so that its exponent is not less than Etiny. This may result
370 in 0 with the sign of the intermediate result and an exponent of Etiny.
520 >>> Decimal((0, (3, 1, 4), -2)) # tuple (sign, digit_tuple, exponent)
973 # exponent, we use the fact that hash(n) == hash(m) for
981 # its adjusted exponent, and its coefficient with trailing
1019 # after adjusting the exponent)
1021 # no exponent required
1054 Engineering notation has an exponent which is a multiple of 3, so there
1270 # Fixing in case the exponent is out of bounds
1343 # result is exact; get as close to ideal exponent as possible
1504 # self = 0 -> remainder = self, with ideal exponent
1520 # adjust both arguments to have the same exponent, then divide
1643 Rounds and fixes the exponent. Does not raise on a sNaN.
1658 # if self is zero then exponent should be between Etiny and
1671 # exp_min is the smallest allowable exponent of the result,
1700 # check whether the rounding pushed the exponent out of range
1927 exponent = _WorkRep(other.to_integral_value())
1931 for i in xrange(exponent.exp):
1933 base = pow(base, exponent.int, modulo)
2017 exponent = xe * 10**ye
2019 exponent = -exponent
2020 # if other is a nonnegative integer, use ideal exponent
2023 zeros = min(exponent-ideal_exponent, p-1)
2026 return _dec_from_triple(0, '1' + '0'*zeros, exponent-zeros)
2036 # now xc is a power of 2; e is its exponent
2164 # adjust the exponent to get as close as possible to the ideal
2165 # exponent, if necessary
2249 # 1**other = 1, but the choice of exponent and the flags
2250 # depend on the exponent of self, and on whether other is a
2276 # compute adjusted exponent of self
2423 """Quantize self so its exponent is the same as that of exp.
2458 'target exponent out of bounds in quantize')
2467 'exponent of quantize result too large for current context')
2475 'exponent of quantize result too large for current context')
2494 """Return True if self and other have the same exponent; otherwise
2509 """Rescale self so that the exponent is exp, either by padding with zeros
2557 # it can happen that the rescale alters the adjusted exponent;
2627 # exponent = self._exp // 2. sqrt(-0) = -0
2657 # is the 'ideal' exponent, to be used if the square root is
2690 # result is exact; rescale to use ideal exponent e
2743 # If the signs are the same then the exponent is used to select
2804 """Return the adjusted exponent of self"""
2964 # the default context. For smaller exponent the result is
2966 # larger exponent the result either overflows or underflows.
3064 """Compute a lower bound for the adjusted exponent of self.ln().
3139 """Compute a lower bound for the adjusted exponent of self.log10().
3146 # exponent of x. For 0.1 <= x <= 10 we use the inequalities
3220 """ Returns the exponent of the magnitude of self's MSD.
3222 The result is the integer which is the exponent of the magnitude
3225 without limiting the resulting exponent).
3243 # otherwise, simply return the adjusted exponent of self, as a
3253 an exponent of 0, and a coefficient whose digits must all be
3674 # if type is '%', adjust exponent of self accordingly
3688 # special case: zeros with a positive exponent can't be
3708 # find digits before and after decimal point, and get exponent
3724 def _dec_from_triple(sign, coefficient, exponent, special=False):
3735 self._exp = exponent
3775 Emin - Minimum exponent
3776 Emax - Maximum exponent
3900 """Returns maximum exponent (= Emax - prec + 1)"""
4537 """ Returns the exponent of the magnitude of the operand's MSD.
4539 The result is the integer which is the exponent of the magnitude
4542 value of that digit and without limiting the resulting exponent).
4755 has the same exponent as the operand.
4953 has the same exponent as the operand.
5046 """Returns a value equal to 'a' (rounded), having the exponent of 'b'.
5050 exponent is being increased), multiplied by a positive power of ten (if
5051 the exponent is being decreased), or is unchanged (if the exponent is
5057 an error condition, the exponent of the result of a quantize is always
5213 """Returns True if the two operands have the same exponent.
5359 When the operand has a negative exponent, the result is the same
5389 When the operand has a negative exponent, the result is the same
5763 # compute log(10) with extra precision = adjusted exponent of c*10**e
5896 # number between the optional sign and the optional exponent must have
5908 (E(?P<exp>[-+]?\d+))? # followed by an optional exponent, or...
6149 exp: exponent, as an integer
6155 format the exponent