diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-25 05:36:55 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-25 05:36:55 +0000 |
commit | 85911c410a6b367ba3555f5e86c8e33db37344af (patch) | |
tree | 1a97c77f3d15e4d031b24462bc4e04ded804645b /lib | |
parent | 43601a1d171333cccea5d656e0f18b77cb1ff987 (diff) | |
download | ruby-85911c410a6b367ba3555f5e86c8e33db37344af.tar.gz |
* ext/socket/socket.c (tcp_s_gethostbyname): was using
uninitialized size_t value. [ruby-talk:76946]
* Minor cleanups.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mathn.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/mathn.rb b/lib/mathn.rb index bab9083c78..26dd0b4a27 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -117,7 +117,7 @@ class Rational Unify = true def inspect - format "%s/%s", @numerator.inspect, @denominator.inspect + format "%s/%s", numerator.inspect, denominator.inspect end alias power! ** @@ -134,8 +134,8 @@ class Rational return Rational(1,1) end - npd = @numerator.prime_division - dpd = @denominator.prime_division + npd = numerator.prime_division + dpd = denominator.prime_division if other < 0 other = -other npd, dpd = dpd, npd @@ -164,11 +164,11 @@ class Rational elsif other.kind_of?(Integer) if other > 0 - num = @numerator ** other - den = @denominator ** other + num = numerator ** other + den = denominator ** other elsif other < 0 - num = @denominator ** -other - den = @numerator ** -other + num = denominator ** -other + den = numerator ** -other elsif other == 0 num = 1 den = 1 @@ -208,11 +208,11 @@ class Rational elsif other.kind_of?(Integer) if other > 0 - num = @numerator ** other - den = @denominator ** other + num = numerator ** other + den = denominator ** other elsif other < 0 - num = @denominator ** -other - den = @numerator ** -other + num = denominator ** -other + den = numerator ** -other elsif other == 0 num = 1 den = 1 |