The Im() function wasn't returning zero for non-Math::Complex
Jarkko Hietaniemi [Fri, 9 Feb 2001 03:28:33 +0000 (03:28 +0000)]
arguments.  The bug reported by John Gamble.

p4raw-id: //depot/perl@8722

lib/Math/Complex.pm

index 066e366..fb6af8c 100644 (file)
@@ -664,7 +664,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;