Skip Menu |

This queue is for tickets about the Math-Complex CPAN distribution.

Report information
The Basics
Id: 132142
Status: new
Priority: 0/
Queue: Math-Complex

People
Owner: Nobody in particular
Requestors: pjacklam [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.36
  • 1.37
  • 1.38
  • 1.39
  • 1.42
  • 1.43
  • 1.44
  • 1.45
  • 1.47
  • 1.48
  • 1.49
  • 1.51
  • 1.52
  • 1.53
  • 1.54
  • 1.55
  • 1.56
  • 1.57
  • 1.58
  • 1.59
Fixed in: (no value)



Subject: Inconsistent behaviour in **
There is an inconsistency in the overloaded "**" operator. Even when both operands are Math::Complex, the output is not always a Math::Complex object. I consider the inconsistency a bug. use strict; use warnings; use Math::Complex; for my $exp (-2 .. 2) { my $x = Math::Complex -> new(2); my $y = Math::Complex -> new($exp); my $z = $x ** $y; print "$x ** $y = $z as a ", ref($z) || "scalar", "\n"; } gives 2 ** -2 = 0.25 as a Math::Complex 2 ** -1 = 0.5 as a Math::Complex 2 ** 0 = 1 as a scalar <=== huh? 2 ** 1 = 2 as a Math::Complex 2 ** 2 = 4 as a Math::Complex