diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-11 15:21:15 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-11 15:21:15 +0000 |
| commit | bcf00e4340d0ed0e9417b3175b84d04a23ba9fd3 (patch) | |
| tree | f7e5bbf43d3d647c50419c2a0f3bbd88cd6d96cb /ext/bigdecimal/lib | |
| parent | 4b8e63e750e875fe64802913d16f53d91e37346d (diff) | |
| download | ruby-bcf00e4340d0ed0e9417b3175b84d04a23ba9fd3.tar.gz ruby-bcf00e4340d0ed0e9417b3175b84d04a23ba9fd3.tar.xz ruby-bcf00e4340d0ed0e9417b3175b84d04a23ba9fd3.zip | |
* ext/bigdecimal/bigdecimal.c (BigDecimal_to_r): moved from
bigdecimal/util, converted into C. [ruby-dev:36805]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/lib')
| -rw-r--r-- | ext/bigdecimal/lib/bigdecimal/util.rb | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/ext/bigdecimal/lib/bigdecimal/util.rb b/ext/bigdecimal/lib/bigdecimal/util.rb index 09e926acd..257781f03 100644 --- a/ext/bigdecimal/lib/bigdecimal/util.rb +++ b/ext/bigdecimal/lib/bigdecimal/util.rb @@ -39,18 +39,6 @@ class BigDecimal < Numeric i + "." + ("0"*(-z)) + f end end - - # Converts a BigDecimal to a Rational. - def to_r - sign,digits,base,power = self.split - numerator = sign*digits.to_i - denomi_power = power - digits.size # base is always 10 - if denomi_power < 0 - Rational(numerator,base ** (-denomi_power)) - else - Rational(numerator * (base ** denomi_power),1) - end - end end class Rational < Numeric |
