Prev Next a_double_compare_xam.m Headings

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
Octave: a_double Comparison Operators: Example and Test
function ok = a_double_compare_xam()
     %
     % load the Cppad Swig library
     m_cppad
     %
     % initialize return variable
     ok = true;
     % -----------------------------------------------------------------------
     two = m_cppad.a_double(2.0);
     three = m_cppad.a_double(3.0);
     %
     ok = ok && two   <  three;
     ok = ok && two   <= three;
     ok = ok && three >  two;
     ok = ok && three >= two;
     ok = ok && three != two;
     ok = ok && three == three;
     %
     ok = ok && ~ (two >  three) ;
     ok = ok && ~ (two >= three) ;
     ok = ok && ~ (two == three) ;
     %
     return;
end

Input File: build/lib/example/octave/a_double_compare_xam.m