This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Math-Complex: netbsd-vax: no inf
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 22 Oct 2016 14:14:03 +0000 (10:14 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 22 Oct 2016 19:51:16 +0000 (15:51 -0400)
cpan/Math-Complex/t/Complex.t

index e62cb88..9833131 100644 (file)
@@ -8,6 +8,9 @@
 
 use Math::Complex 1.54;
 
+our $vax_float = (pack("d",1) =~ /^[\x80\x10]\x40/);
+our $has_inf   = !$vax_float;
+
 my ($args, $op, $target, $test, $test_set, $try, $val, $zvalue, @set, @val);
 
 $test = 0;
@@ -115,9 +118,14 @@ my $pii  = cplx(0, pi);
 my $pip2 = cplx(pi/2, 0);
 my $pip4 = cplx(pi/4, 0);
 my $zero = cplx(0, 0);
-my $inf  = 9**9**9;
 ';
 
+if ($has_inf) {
+    $constants .= <<'EOF';
+my $inf  = 9**9**9;
+EOF
+}
+
 push(@script, $constants);