Ticket #3927: trac3927-fix-gcd-lcm.patch
| File trac3927-fix-gcd-lcm.patch, 1.5 kB (added by cwitty, 5 months ago) |
|---|
-
a/sage/structure/factorization.py
old new 1000 1000 1001 1001 """ 1002 1002 if not isinstance(other, Factorization): 1003 r eturn self * Factorization([(other, 1)])1003 raise NotImplementedError, "can't take gcd of factorization and non-factorization" 1004 1004 if self.is_commutative() and other.is_commutative(): 1005 1005 d1 = dict(self) 1006 1006 d2 = dict(other) … … 1023 1023 1024 1024 """ 1025 1025 if not isinstance(other, Factorization): 1026 r eturn self * Factorization([(other, 1)])1026 raise NotImplementedError, "can't take lcm of factorization and non-factorization" 1027 1027 if self.is_commutative() and other.is_commutative(): 1028 1028 d1 = dict(self) 1029 1029 d2 = dict(other) … … 1032 1032 s[a] = max(d1.get(a,0),d2.get(a,0)) 1033 1033 return Factorization(list(s.iteritems())) 1034 1034 else: 1035 raise NotImplementedError, " gcdis not implemented for non-commutative factorizations"1035 raise NotImplementedError, "lcm is not implemented for non-commutative factorizations" 1036 1036 1037 1037 1038 1038 def is_integral(self):