Prev Next a_double_property_xam.py Headings

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
Python: a_double Properties: Example and Test
def a_double_property_xam() :
     #
     # load the Cppad Swig library
     import py_cppad
     #
     # initialize return variable
     ok = True
     # ---------------------------------------------------------------------
     three = py_cppad.a_double(3.0)
     #
     ok = ok and three.value()   == 3.0
     ok = ok and three.parameter()
     ok = ok and not three.variable()
     #
     # near_equal
     r3 = three.sqrt() 
     ok = ok and three.near_equal( r3 * r3) ;
     #
     return( ok )
#

Input File: build/lib/example/python/a_double_property_xam.py