From: Jarkko Hietaniemi Date: Fri, 9 Feb 2001 03:28:33 +0000 (+0000) Subject: The Im() function wasn't returning zero for non-Math::Complex X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=178326e780f3f154b61c269acad640244e0c5907;p=p5sagit%2Fp5-mst-13.2.git The Im() function wasn't returning zero for non-Math::Complex arguments. The bug reported by John Gamble. p4raw-id: //depot/perl@8722 --- diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index 066e366..fb6af8c 100644 --- a/lib/Math/Complex.pm +++ b/lib/Math/Complex.pm @@ -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;