From: Abigail Date: Tue, 15 Aug 2000 04:06:38 +0000 (+0000) Subject: Fix the lib/complex failure of X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e97e26fa69d442681238dfa237f8dab8a47fd168;p=p5sagit%2Fp5-mst-13.2.git Fix the lib/complex failure of Subject: [ID 20000814.005] Not OK: perl v5.6.0 on i686-linux-64int 2.2.13 Message-Id: <20000815040638.8524.qmail@foad.org> Linux long double accuracy issue: something that when printed with %g looks like "2" but int() of it is 1. p4raw-id: //depot/perl@6689 --- diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index e5434f4..af2b2a0 100644 --- a/lib/Math/Complex.pm +++ b/lib/Math/Complex.pm @@ -1393,11 +1393,11 @@ sub stringify_polar { $t -= int(CORE::abs($t) / pit2) * pit2; - if ($format{polar_pretty_print}) { + if ($format{polar_pretty_print} && $t) { my ($a, $b); for $a (2..9) { $b = $t * $a / pi; - if (int($b) == $b) { + if ($b =~ /^-?\d+$/) { $b = $b < 0 ? "-" : "" if CORE::abs($b) == 1; $theta = "${b}pi/$a"; last;