From 9467d7a02430cbe76368148fe8097d7d029e6def Mon Sep 17 00:00:00 2001 From: tadf Date: Sat, 20 Sep 2008 22:49:56 +0000 Subject: * complex.c: an instance method image has been removed and uses "imag" instead of "image". * complex.c: two instance method re and im are removed. * rational.c: follows the above changes. * include/ruby/ruby.h: ditto. * gc.c: ditto. * lib/cmath.rb: ditto. * lib/mathn.rb: ditto. * lib/complex.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/mathn.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/mathn.rb') diff --git a/lib/mathn.rb b/lib/mathn.rb index b29f994ac9..e918608b0d 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -37,7 +37,7 @@ class Rational if other.kind_of?(Rational) other2 = other if self < 0 - return Complex.__send__(:new!, self, 0) ** other + return Complex(self, 0.0) ** other elsif other == 0 return Rational(1,1) elsif self == 0 @@ -99,7 +99,7 @@ module Math remove_method(:sqrt) def sqrt(a) if a.kind_of?(Complex) - abs = sqrt(a.real*a.real + a.image*a.image) + abs = sqrt(a.real*a.real + a.imag*a.imag) # if not abs.kind_of?(Rational) # return a**Rational(1,2) # end @@ -108,7 +108,7 @@ module Math # if !(x.kind_of?(Rational) and y.kind_of?(Rational)) # return a**Rational(1,2) # end - if a.image >= 0 + if a.imag >= 0 Complex(x, y) else Complex(x, -y) -- cgit v1.2.3