Prev Next a_double_unary_op_xam.m Headings

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
Octave: a_double Unary Plus and Minus: Example and Test
% This test fails in Octave and so is skipped by make check_lib_octave
function ok = a_double_unary_op_xam()
     %
     % load the Cppad Swig library
     m_cppad
     %
     % initialize return variable
     ok = true;
     % -----------------------------------------------------------------------
     two = m_cppad.a_double(2.0);
     plus_two = + two ;
     minus_two = - two ;
     %
     ok = ok && plus_two.value() == 2.0;
     ok = ok && minus_two.value() == -2.0;
     %
     return;
end

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