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 theothersequence elements as the right operand. They return a result sequence of the same type.The method signatures are of the following form (where
opis 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) constAdds elements in left and right.Sequence<T> operator -(Sequence<T> const& other) constSubtracts elements in right from left.Sequence<T> operator *(Sequence<T> const& other) constMultiplies elements in left and right.Sequence<T> operator /(Sequence<T> const& other) constDivides elements in left by right.Sequence<T> operator %(Sequence<T> const& other) constReturns 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; ... }