a few typo fixes
[p5sagit/p5-mst-13.2.git] / lib / Math / Complex.pm
index 066e366..19d30b0 100644 (file)
@@ -9,15 +9,25 @@ package Math::Complex;
 
 our($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $Inf);
 
-$VERSION = 1.31;
+$VERSION = 1.32;
 
 BEGIN {
     unless ($^O eq 'unicosmk') {
         my $e = $!;
-       # We do want an arithmetic overflow.
-        eval '$Inf = CORE::exp(CORE::exp(30))';
+       # We do want an arithmetic overflow, Inf INF inf Infinity:.
+        undef $Inf unless eval <<'EOE' and $Inf =~ /^inf(?:inity)?$/i;
+         local $SIG{FPE} = sub {die};
+         my $t = CORE::exp 30;
+         $Inf = CORE::exp $t;
+EOE
+       if (!defined $Inf) {            # Try a different method
+         undef $Inf unless eval <<'EOE' and $Inf =~ /^inf(?:inity)?$/i;
+           local $SIG{FPE} = sub {die};
+           my $t = 1;
+           $Inf = $t + "1e99999999999999999999999999999999";
+EOE
+       }
         $! = $e; # Clear ERANGE.
-        undef $Inf unless $Inf =~ /^inf(?:inity)?$/i; # Inf INF inf Infinity
     }
     $Inf = "Inf" if !defined $Inf || !($Inf > 0); # Desperation.
 }
@@ -664,7 +674,7 @@ sub Re {
 #
 sub Im {
        my ($z, $Im) = @_;
-       return $z unless ref $z;
+       return 0 unless ref $z;
        if (defined $Im) {
            $z->{'cartesian'} = [ ${$z->cartesian}[0], $Im ];
            $z->{c_dirty} = 0;
@@ -1551,7 +1561,7 @@ be called an extension, would it?).
 
 A I<new> operation possible on a complex number that is
 the identity for real numbers is called the I<conjugate>, and is noted
-with an horizontal bar above the number, or C<~z> here.
+with a horizontal bar above the number, or C<~z> here.
 
         z = a + bi
        ~z = a - bi
@@ -1650,7 +1660,7 @@ I<arg>, I<abs>, I<log>, I<csc>, I<cot>, I<acsc>, I<acot>, I<csch>,
 I<coth>, I<acosech>, I<acotanh>, have aliases I<rho>, I<theta>, I<ln>,
 I<cosec>, I<cotan>, I<acosec>, I<acotan>, I<cosech>, I<cotanh>,
 I<acosech>, I<acotanh>, respectively.  C<Re>, C<Im>, C<arg>, C<abs>,
-C<rho>, and C<theta> can be used also also mutators.  The C<cbrt>
+C<rho>, and C<theta> can be used also as mutators.  The C<cbrt>
 returns only one of the solutions: if you want all three, use the
 C<root> function.
 
@@ -1826,7 +1836,7 @@ or
        Died at...
 
 For the C<csc>, C<cot>, C<asec>, C<acsc>, C<acot>, C<csch>, C<coth>,
-C<asech>, C<acsch>, the argument cannot be C<0> (zero).  For the the
+C<asech>, C<acsch>, the argument cannot be C<0> (zero).  For the
 logarithmic functions and the C<atanh>, C<acoth>, the argument cannot
 be C<1> (one).  For the C<atanh>, C<acoth>, the argument cannot be
 C<-1> (minus one).  For the C<atan>, C<acot>, the argument cannot be