Prev Next a_double_property_xam.cpp Headings

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
C++: a_double Properties: Example and Test
# include <cstdio>
# include <cppad/py/cppad_py.hpp>

bool a_double_property_xam(void) {
     using cppad_py::a_double;
     //
     // initialize return variable
     bool ok = true;
     //------------------------------------------------------------------------
     a_double a3(3.0);
     //
     ok = ok && a3   == 3.0;
     ok = ok && a3.parameter();
     ok = ok && ! a3.variable();
     //
     // near_equal
     a_double r3 = a3.sqrt() ;
     ok = ok && a3.near_equal( r3 * r3) ;;
     //
     return( ok );
}

Input File: lib/example/cplusplus/a_double_property_xam.cpp