summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/lib
diff options
context:
space:
mode:
authorKenta Murata <mrkn@users.noreply.github.com>2019-10-08 09:06:28 +0900
committerGitHub <noreply@github.com>2019-10-08 09:06:28 +0900
commitdd0c75fdc2104a6ba38b68d4431a572504a3bbc2 (patch)
treecea82d0d8ea56e8c7d03158f35654adb974d6bd0 /ext/bigdecimal/lib
parent59c3b1c9c843fcd2d30393791fe224e5789d1677 (diff)
Import changes from ruby/bigdecimal (#2531)
Sync to ruby/bigdecimal@92356ba71c6bd325b0ab618c634a7aecf8cdc767
Notes
Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
Diffstat (limited to 'ext/bigdecimal/lib')
-rw-r--r--ext/bigdecimal/lib/bigdecimal.rb5
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb7
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb4
3 files changed, 6 insertions, 10 deletions
diff --git a/ext/bigdecimal/lib/bigdecimal.rb b/ext/bigdecimal/lib/bigdecimal.rb
index 96995a32b39..8fd2587c841 100644
--- a/ext/bigdecimal/lib/bigdecimal.rb
+++ b/ext/bigdecimal/lib/bigdecimal.rb
@@ -1,6 +1 @@
require 'bigdecimal.so'
-
-def BigDecimal.new(*args, **kwargs)
- warn "BigDecimal.new is deprecated; use BigDecimal() method instead.", uplevel: 1
- BigDecimal(*args, **kwargs)
-end
diff --git a/ext/bigdecimal/lib/bigdecimal/jacobian.rb b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
index 84c50248b70..5e293042998 100644
--- a/ext/bigdecimal/lib/bigdecimal/jacobian.rb
+++ b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: false
-#
+
+require 'bigdecimal'
+
# require 'bigdecimal/jacobian'
#
# Provides methods to compute the Jacobian matrix of a set of equations at a
@@ -21,9 +23,6 @@
#
# fx is f.values(x).
#
-
-require 'bigdecimal'
-
module Jacobian
module_function
diff --git a/ext/bigdecimal/lib/bigdecimal/util.rb b/ext/bigdecimal/lib/bigdecimal/util.rb
index 88f490cb45e..4ece8347bdb 100644
--- a/ext/bigdecimal/lib/bigdecimal/util.rb
+++ b/ext/bigdecimal/lib/bigdecimal/util.rb
@@ -6,7 +6,6 @@
#++
require 'bigdecimal'
-require 'bigdecimal/util.so'
class Integer < Numeric
# call-seq:
@@ -66,6 +65,9 @@ class String
#
# See also BigDecimal::new.
#
+ def to_d
+ BigDecimal.interpret_loosely(self)
+ end
end