\section{COMPARISONOPS Array Comparison Operators}

\subsection{Usage}

There are a total of six comparison operators available in FreeMat, all of which are binary operators with the following syntax
\begin{verbatim}
  y = a < b
  y = a <= b
  y = a > b
  y = a >= b
  y = a ~= b
  y = a == b
\end{verbatim}
where \verb|a| and \verb|b| are numerical arrays or scalars, and \verb|y| is a \verb|logical| array of the appropriate size.  Each of the operators has three modes of operation, summarized in the following list:
\begin{enumerate}
\item  \verb|a| is a scalar, \verb|b| is an n-dimensional array - the output is then the same size as \verb|b|, and contains the result of comparing each element in \verb|b| to the scalar \verb|a|.

\item  \verb|a| is an n-dimensional array, \verb|b| is a scalar - the output is the same size as \verb|a|, and contains the result of comparing each element in \verb|a| to the scalar \verb|b|.

\item  \verb|a| and \verb|b| are both n-dimensional arrays of the same size - the output is then the same size as both \verb|a| and \verb|b|, and contains the result of an element-wise comparison between \verb|a| and \verb|b|.

\end{enumerate}
The operators behave the same way as in \verb|C|, with unequal types meing promoted using the standard type promotion rules prior to comparisons.  The only difference is that in FreeMat, the not-equals operator is \verb|~=| instead of \verb|!=|.
\subsection{Examples}

Some simple examples of comparison operations.  First a comparison with a scalar:
\begin{verbatim}
--> a = randn(1,5)
a = 
  <double>  - size: [1 5]
 
Columns 1 to 3
 -0.12192748668684152   0.50277125397736855   0.74762055527748861  
 
Columns 4 to 5
 -0.84486868009987870   0.43875889485634545  
--> a>0
ans = 
  <logical>  - size: [1 5]
 
Columns 1 to 5
 0  1  1  0  1  

\end{verbatim}
Next, we construct two vectors, and test for equality:
\begin{verbatim}
--> a = [1,2,5,7,3]
a = 
  <int32>  - size: [1 5]
 
Columns 1 to 5
 1  2  5  7  3  
--> b = [2,2,5,9,4]
b = 
  <int32>  - size: [1 5]
 
Columns 1 to 5
 2  2  5  9  4  
--> c = a == b
c = 
  <logical>  - size: [1 5]
 
Columns 1 to 5
 0  1  1  0  0  

\end{verbatim}
