Binary C++ Sequence Methods

The following binary C++ Sequence methods and operators take a single argument other, perform the indicated operation on the object's sequence elements as the left operand and the other sequence elements as the right operand. They return a result sequence of the same type.

The method signatures are of the following form (where op is the indicated operation):

    Sequence<T> operator op(Sequence<T> const& other) const;

The following list presents the available arithmetic operators and methods:

Sequence<T> operator +(Sequence<T> const& other) const
Adds elements in left and right.
Sequence<T> operator -(Sequence<T> const& other) const
Subtracts elements in right from left.
Sequence<T> operator *(Sequence<T> const& other) const
Multiplies elements in left and right.
Sequence<T> operator /(Sequence<T> const& other) const
Divides elements in left by right.
Sequence<T> operator %(Sequence<T> const& other) const
Returns the modulo of elements in left by elements in right.
Sequence<T> max(Sequence<T> const& other) const;
Returns the maximum of the corresponding elements in left and right.
Sequence<T> min(Sequence<T> const& other) const;
Returns the minimum of the corresponding elements in left and right.

Example

Following is an example code snippet demonstrating a binary method:

    {
        ...
        Sequence<float> high = quote.high_iterator();
        Sequence<float> low = quote.low_iterator();
        Sequence<mco_seq_bool> diff = high - low;
        ...
    }