# Logical C Sequence Functions

> The following logical C functions take one boolean sequence argument input, or two boolean input sequences, left and right, and produce the boolean result sequence.

> If the two input sequence arguments are of different lengths the operation will be performed on only the number of elements in the shorter of the two sequences.

> The function signatures are of the following two forms:

>         MCO_RET mco_seq_operator(mco_seq_iterator_h result,
>                 mco_seq_iterator_h input);

> or

>         MCO_RET mco_seq_operator(mco_seq_iterator_h result,
>                 mco_seq_iterator_h left,
>                 mco_seq_iterator_h right);

> where operator is one of the following:

> mco_seq_not() | The element of the result sequence is the logical not of the corresponding element in input
> mco_seq_and() | The element of the result sequence is the logical and of the corresponding elements in left and right
> mco_seq_or() | The element of the result sequence is the logical or of the corresponding elements in left and right
> mco_seq_xor() | The element of the result sequence is the logical exclusive or of the corresponding elements in left and right

> ## Example

> Following is an example code snippet demonstrating a logical operator function:

>         {
>             mco_trans_h trans;
>             mco_cursor_t quote_cursor;
>             Quote quote;
>             mco_seq_iterator_t high_iterator, low_iterator;
>             mco_seq_iterator_t eq_iterator, result_iterator;
>             MCO_RET rc;
>             ...

>             for (rc = mco_cursor_first(trans, &quote_cursor);
>                 rc != MCO_S_CURSOR_END;
>                 rc = mco_cursor_next(trans, &quote_cursor))
>             {
>                 Quote_from_cursor(trans, &quote_cursor, &quote);
>                 Quote_high_iterator(&quote, &high_iterator);
>                 Quote_low_iterator(&quote, &low_iterator);
>                 ...
>                 rc = mco_seq_eq_float(&eq_iterator, &low_iterator, &high_iterator);
>                 rc = mco_seq_not(&result_iterator, &eq_iterator);

>                 ...
>             }
>             ...
>         }