diff options
Diffstat (limited to 'Lib/fractions.py')
-rw-r--r-- | Lib/fractions.py | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/Lib/fractions.py b/Lib/fractions.py index 2e7047a..501f4b7 100644 --- a/Lib/fractions.py +++ b/Lib/fractions.py @@ -10,31 +10,9 @@ import operator import re import sys -__all__ = ['Fraction', 'gcd'] +__all__ = ['Fraction'] - -def gcd(a, b): - """Calculate the Greatest Common Divisor of a and b. - - Unless b==0, the result will have the same sign as b (so that when - b is divided by it, the result comes out positive). - """ - import warnings - warnings.warn('fractions.gcd() is deprecated. Use math.gcd() instead.', - DeprecationWarning, 2) - if type(a) is int is type(b): - if (b or a) < 0: - return -math.gcd(a, b) - return math.gcd(a, b) - return _gcd(a, b) - -def _gcd(a, b): - # Supports non-integers for backward compatibility. - while b: - a, b = b, a%b - return a - # Constants related to the hash implementation; hash(x) is based # on the reduction of x modulo the prime _PyHASH_MODULUS. _PyHASH_MODULUS = sys.hash_info.modulus |