Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » operators » +
next | previous | forward | backward | up | index | toc

+ -- a unary or binary operator, usually used for addition

Description

In most cases, this operator refers to standard addition.

In many cases, the integer 1 can be used as the identity, and scalars function as multiples of the identity. For example, the 1 below refers to the identity matrix and the 2 to twice the identity matrix.
i1 : M = matrix{{1,2,3},{2,3,4},{3,4,6}}

o1 = | 1 2 3 |
     | 2 3 4 |
     | 3 4 6 |

              3       3
o1 : Matrix ZZ  <-- ZZ
i2 : M+1, M+2

o2 = (| 2 2 3 |, | 3 2 3 |)
      | 2 4 4 |  | 2 5 4 |
      | 3 4 7 |  | 3 4 8 |

o2 : Sequence

Intervals

If one of the addends is an RRi, the output is an interval containing all sums of pairs in the addends.

i3 : 2+interval(1,3)

o3 = [3,5]

o3 : RRi (of precision 53)
i4 : interval(1,3)+interval(-1,2)

o4 = [0,5]

o4 : RRi (of precision 53)
i5 : interval(-1,1)+interval(-1,1)

o5 = [-2,2]

o5 : RRi (of precision 53)

See also

Ways to use symbol +:

  • + CC
  • + Constant
  • + QQ
  • + RingElement
  • + RR
  • + RRi
  • + Vector
  • + ZZ
  • CC + CC
  • CC + InfiniteNumber
  • CC + QQ
  • CC + RR
  • CC + ZZ
  • Constant + Constant
  • Constant + InexactNumber
  • Constant + Number
  • Constant + RingElement
  • Ideal + Number
  • Ideal + RingElement
  • InexactNumber + Constant
  • InexactNumber + RingElement
  • InfiniteNumber + CC
  • InfiniteNumber + InfiniteNumber
  • InfiniteNumber + Number
  • Matrix + Matrix
  • Matrix + Number
  • Matrix + RingElement
  • MonomialIdeal + MonomialIdeal
  • MutableMatrix + MutableMatrix
  • Number + Constant
  • Number + Ideal
  • Number + InfiniteNumber
  • Number + Matrix
  • Number + RingElement
  • Number + Vector
  • QQ + CC
  • QQ + QQ
  • QQ + RR
  • QQ + RRi
  • QQ + ZZ
  • RingElement + Constant
  • RingElement + Ideal
  • RingElement + InexactNumber
  • RingElement + Matrix
  • RingElement + Number
  • RingElement + RingElement
  • RingElement + Vector
  • RR + CC
  • RR + QQ
  • RR + RR
  • RR + RRi
  • RR + ZZ
  • RRi + QQ
  • RRi + RR
  • RRi + RRi
  • RRi + ZZ
  • Vector + Number
  • Vector + RingElement
  • Vector + Vector
  • ZZ + CC
  • ZZ + QQ
  • ZZ + RR
  • ZZ + RRi
  • ZZ + ZZ
  • Ideal + Ideal -- sum of ideals
  • List + List -- sum of two vectors
  • Module + Module -- sum of submodules
  • Tally + Tally -- union of tallies
  • Set + Set -- see union(Set,Set) -- set union
  • VirtualTally + VirtualTally -- union of tallies

For the programmer

The object + is a keyword.

This operator may be used as a binary operator in an expression like x+y. The user may install binary methods for handling such expressions with code such as

         X + Y := (x,y) -> ...

where X is the class of x and Y is the class of y.

This operator may be used as a prefix unary operator in an expression like +y. The user may install a method for handling such expressions with code such as

           + Y := (y) -> ...

where Y is the class of y.


The source of this document is in Macaulay2Doc/operators/plus.m2:104:0.