package a_double_ad_binary_xam; sub a_double_ad_binary_xam() { # check for standard perl programming conventions use strict; use warnings; # # load the Cppad Swig library use pm_cppad; # # initilaize return variable my $ok = 1; # --------------------------------------------------------------------- my $two = new pm_cppad::a_double(2.0); my $three = new pm_cppad::a_double(3.0); # my $five = $two + $three; my $six = $two * $three; my $neg_one = $two - $three; my $two_thirds = $two / $three; # $ok = $ok && $five->value() == 5.0; $ok = $ok && $six->value() == 6.0; $ok = $ok && $neg_one->value() == -1.0; $ok = $ok && 0.5 < $two_thirds->value(); $ok = $ok && $two_thirds->value() < 1.0; $ok = $ok && $five < $six; # return( $ok ); }