Changeset 7454:0cb746e1a4bd
- Timestamp:
- 11/19/07 21:47:51 (6 years ago)
- Branch:
- default
- Location:
- sage
- Files:
-
- 2 edited
-
rings/ideal.py (modified) (2 diffs)
-
structure/element.pyx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sage/rings/ideal.py
r7373 r7454 365 365 366 366 def __contains__(self, x): 367 """ 368 Returns True if x is in the ideal self. 369 370 EXAMPLES: 371 sage: P.<x> = PolynomialRing(ZZ) 372 sage: I = P.ideal(x^2-2) 373 sage: x^2 in I 374 False 375 sage: x^2-2 in I 376 True 377 sage: x^2-3 in I 378 False 379 """ 367 380 if self.gen().is_zero(): 368 381 return x.is_zero() … … 391 404 """ 392 405 Returns True if self divides other. 406 407 EXAMPLES: 408 sage: P.<x> = PolynomialRing(QQ) 409 sage: I = P.ideal(x) 410 sage: J = P.ideal(x^2) 411 sage: I.divides(J) 412 True 413 sage: J.divides(I) 414 False 393 415 """ 394 416 if isinstance(other, Ideal_principal): -
sage/structure/element.pyx
r7373 r7454 1617 1617 """ 1618 1618 raise NotImplementedError 1619 1620 def divides(self, x): 1621 """ 1622 Return True if self divides x. 1623 1624 EXAMPLES: 1625 sage: P.<x> = PolynomialRing(QQ) 1626 sage: x.divides(x^2) 1627 True 1628 sage: x.divides(x^2+2) 1629 False 1630 sage: (x^2+2).divides(x) 1631 False 1632 sage: P.<x> = PolynomialRing(ZZ) 1633 sage: x.divides(x^2) 1634 True 1635 sage: x.divides(x^2+2) 1636 False 1637 sage: (x^2+2).divides(x) 1638 False 1639 """ 1640 return (x % self) == 0 1619 1641 1620 1642 def mod(self, I):
Note: See TracChangeset
for help on using the changeset viewer.
