>From: Bil Kleb > Two questions: > > a) who's the current author? See in lib/complex.rb. > b) do you know the fix? Here is a patch for ruby-1.7. --- lib/complex.rb.~1.8.~ Mon Apr 29 21:25:24 2002 +++ lib/complex.rb Thu May 30 11:15:52 2002 @@ -328,22 +328,6 @@ if not defined? Rational alias power! ** end - - def ** (other) - if self < 0 - Complex.new(self) ** other - else - if defined? Rational - if other >= 0 - self.power!(other) - else - Rational.new!(self,1)**other - end - else - self.power!(other) - end - end - end end class Bignum @@ -374,7 +358,13 @@ Complex(0,sqrt!(-z)) end else - z**Rational(1,2) + if z.image < 0 + sqrt(z.conjugate).conjugate + else + r = z.abs + x = z.real + Complex(sqrt!((r+x)/2),sqrt!((r-x)/2)) + end end end -- Masa Tanaka