[next][previous][up][top][index]
search for:

Ideal == ZZ -- equality

Synopsis:

  • Usage: I == n
  • Operator: == -- equality
  • Input:
  • I, an instance of class Ideal.
  • n, an instance of class ZZ: either 0, or 1.
  • Output:
  • n, an instance of class Thing: either 0, or 1.
  • If n==1, then determines whether I is the unit ideal. If n==0, then determines whether I is the zero ideal. Any other value for n is an error.

    i1 : R = QQ[x];
    i2 : ideal(x^2,x+1) == 1

    o2 = true
    i3 : ideal(0_R) == 0

    o3 = true

    Code:

         -- ../../../Macaulay2/m2/modules2.m2:358-364
         Ideal == ZZ := (I,n) -> (
              if n === 0
              then I.generators == 0
              else if n === 1
              then 1_(ring I) % I == 0
              else error "attempted to compare ideal to integer not 0 or 1"
              )

    [next][previous][up][top][index]
    search for: