diff options
author | Abigail <abigail@abigail.be> | 2000-08-15 04:06:38 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-18 04:12:30 +0000 |
commit | e97e26fa69d442681238dfa237f8dab8a47fd168 (patch) | |
tree | 065db3ee34a8b81614b02826a15dcb26e2e60300 /lib/Math | |
parent | ad66e0ebddf4284c422b779bd6dd8b67482795b8 (diff) | |
download | perl-e97e26fa69d442681238dfa237f8dab8a47fd168.tar.gz |
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
Diffstat (limited to 'lib/Math')
-rw-r--r-- | lib/Math/Complex.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Math/Complex.pm b/lib/Math/Complex.pm index e5434f48d7..af2b2a0567 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; |