sasoptpy.Expression.add

Expression.add(self, other, sign=1)[source]

Combines two expressions and produces a new one

Parameters
otherfloat or Expression

Second expression or constant value to be added

signint, optional

Sign of the addition, 1 or -1

Returns
rExpression

Reference to the outcome of the operation

Notes

  • It is preferable to use regular Python operation, instead of calling this method:

    >>> e = x - y
    >>> f = 3 * x + 2 * y
    >>> g = e + f
    >>> print(g)
    4 * x + y