Python: a_double Assignment Operators: Example and Test
defa_double_assign_xam() :
## load the Cppad Swig libraryimport py_cppad
## initialize return variable
ok = True
# ---------------------------------------------------------------------
x = py_cppad.a_double(2.0)
#
x = py_cppad.a_double(3.0);
ok = ok and x.value() == 3.0
#
x += py_cppad.a_double(2.0);
ok = ok and x.value() == 5.0
#
x -= py_cppad.a_double(1.0);
ok = ok and x.value() == 4.0
#
x *= py_cppad.a_double(3.0);
ok = ok and x.value() == 12.0
#
x /= py_cppad.a_double(4.0);
ok = ok and x.value() == 3.0
#return( ok )
#