Prev Next a_double_unary_op_xam.py Headings

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
Python: a_double Unary Plus and Minus: Example and Test
def a_double_unary_op_xam() :
     #
     import numpy
     import cppad_py
     #
     # initialize return variable
     ok = True
     # ---------------------------------------------------------------------
     a2 = cppad_py.a_double(2.0)
     aplus2 = + a2
     a2_minus = - a2
     #
     ok = ok and aplus2 == 2.0
     ok = ok and a2_minus == -2.0
     #
     return( ok )
#

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