1#!perl 2 3use strict; 4use warnings; 5 6use Math::Matrix; 7use Test::More tests => 3; 8 9my $tol = 1e-10; 10 11my $x = Math::Matrix -> new([[3, 4]]) -> normalize(); 12is(ref($x), 'Math::Matrix', '$x is a Math::Matrix'); 13cmp_ok(abs($x -> [0][0] - 0.6), '<', $tol, 14 "\$x->[0][0] has the right value within $tol"); 15cmp_ok(abs($x -> [0][1] - 0.8), '<=', $tol, 16 "\$x->[0][1] has the right value within $tol"); 17