diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-07-03 15:10:42 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-07-03 15:10:42 +0000 |
commit | c97c62a594c05c96d7f6bb65b20ff9f0ded8ee88 (patch) | |
tree | 47888d3e2b8a670fcd6c77fa9e61aaab0f55af39 /lib | |
parent | d7c1ab0713a0505c88fe27a978288c9c36f2713a (diff) |
* lib/mathn.rb: merge from 1.7: add Rational#inspect().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mathn.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mathn.rb b/lib/mathn.rb index 8d92272159..f3f7a95a48 100644 --- a/lib/mathn.rb +++ b/lib/mathn.rb @@ -122,7 +122,11 @@ end class Rational Unify = true - + + def inspect + format "%s/%s", @numerator.inspect, @denominator.inspect + end + alias power! ** def ** (other) |