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() :
     #
     import numpy
     import cppad_py
     #
     # initialize return variable
     ok = True
     # ---------------------------------------------------------------------
     a3 = cppad_py.a_double(3.0)
     #
     ok = ok and a3   == 3.0
     ok = ok and a3.parameter()
     ok = ok and not a3.variable()
     #
     # near_equal
     r3 = a3.sqrt()
     ok = ok and a3.near_equal( r3 * r3) ;
     #
     return( ok )
#

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