Yet another way to say Infinity: HP-UX calls its "++".
Jarkko Hietaniemi [Mon, 6 Aug 2001 15:02:48 +0000 (15:02 +0000)]
p4raw-id: //depot/perl@11598

lib/Math/BigInt/t/bigintpm.t

index 4b28f0b..e456a3e 100755 (executable)
@@ -531,11 +531,15 @@ $x = Math::BigInt->new('+inf'); ok_inf ($x,$y);
 
 # libc are confused what to call Infinity
 
+sub fix_inf {
+    $_[0] =~ s/^(inf(?:inity)?|\+\+)$/Inf/i; # HP-UX calls it "++"
+}
+
 sub ok_inf {
     my ($x, $y) = @_;
 
-    $x =~ s/^inf(?:inity)?/Inf/i;
-    $y =~ s/^inf(?:inity)?/Inf/i;
+    fix_inf($x);
+    fix_inf($y);
 
     ok($x, $y);
 }