diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2020-10-06 22:13:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 22:13:34 -0700 |
commit | 1cc1a8f11a769c42a162229f3e1fb3a0fa74d4b9 (patch) | |
tree | e739e0905d3b06a1ebbbfca18fbf324989b99ad4 /Lib/_pydecimal.py | |
parent | 044a1048ca93d466965afc027b91a5a9eb9ce23c (diff) | |
download | cpython-git-revert-6121-is_integer.tar.gz |
Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)"revert-6121-is_integer
This reverts commit 58a7da9e125422323f79c4ee95ac5549989d8162.
Diffstat (limited to 'Lib/_pydecimal.py')
-rw-r--r-- | Lib/_pydecimal.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index 8c0ef57092..ab989e5206 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py @@ -3164,12 +3164,6 @@ class Decimal(object): """Return True if self is a zero; otherwise return False.""" return not self._is_special and self._int == '0' - def is_integer(self): - """Return True is self is finite and integral; otherwise False.""" - if self._is_special: - return False - return self.to_integral_value(rounding=ROUND_FLOOR) == self - def _ln_exp_bound(self): """Compute a lower bound for the adjusted exponent of self.ln(). In other words, compute r such that self.ln() >= 10**r. Assumes @@ -4665,25 +4659,6 @@ class Context(object): a = _convert_other(a, raiseit=True) return a.is_zero() - def is_integer(self, a): - """Return True if the operand is integral; otherwise return False. - - >>> ExtendedContext.is_integer(Decimal('0')) - True - >>> ExtendedContext.is_integer(Decimal('2.50')) - False - >>> ExtendedContext.is_integer(Decimal('-0E+2')) - True - >>> ExtendedContext.is_integer(Decimal('-0.5')) - False - >>> ExtendedContext.is_integer(Decimal('NaN')) - False - >>> ExtendedContext.is_integer(10) - True - """ - a = _convert_other(a, raiseit=True) - return a.is_integer() - def ln(self, a): """Returns the natural (base e) logarithm of the operand. |