summaryrefslogtreecommitdiff
path: root/lib/Math/Complex.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Math/Complex.pm')
-rw-r--r--lib/Math/Complex.pm4
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;