aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2020-10-07 16:43:44 -0700
committerGitHub <noreply@github.com>2020-10-07 16:43:44 -0700
commit4e0ce820586e93cfcefb16c2a3df8eaefc54cbca (patch)
tree62e95d644abcbc04dd6baedc9b3f44f42d4d974f /Lib/_pydecimal.py
parentbpo-41923: PEP 613: Add TypeAlias to typing module (#22532) (diff)
downloadcpython-4e0ce820586e93cfcefb16c2a3df8eaefc54cbca.tar.gz
cpython-4e0ce820586e93cfcefb16c2a3df8eaefc54cbca.tar.bz2
cpython-4e0ce820586e93cfcefb16c2a3df8eaefc54cbca.zip
Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)" (GH-22584)
This reverts commit 58a7da9e125422323f79c4ee95ac5549989d8162.
Diffstat (limited to 'Lib/_pydecimal.py')
-rw-r--r--Lib/_pydecimal.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py
index 8c0ef570922..ab989e5206a 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.