mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/bigdecimal: update class method call style from :: to .
in documentation and usage. * ext/bigdecimal/lib/bigdecimal/math.rb: [DOC] fix examples values. Computations were made using ruby 2.0.0p247 to ensure no effect of the recent BigDecimal bug. * ext/bigdecimal/sample/nlsolve.rb: fix indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
72385b042d
commit
1cc709a84a
6 changed files with 41 additions and 29 deletions
|
@ -11,11 +11,11 @@ include Newton
|
|||
|
||||
class Function # :nodoc: all
|
||||
def initialize()
|
||||
@zero = BigDecimal::new("0.0")
|
||||
@one = BigDecimal::new("1.0")
|
||||
@two = BigDecimal::new("2.0")
|
||||
@ten = BigDecimal::new("10.0")
|
||||
@eps = BigDecimal::new("1.0e-16")
|
||||
@zero = BigDecimal.new("0.0")
|
||||
@one = BigDecimal.new("1.0")
|
||||
@two = BigDecimal.new("2.0")
|
||||
@ten = BigDecimal.new("10.0")
|
||||
@eps = BigDecimal.new("1.0e-16")
|
||||
end
|
||||
def zero;@zero;end
|
||||
def one ;@one ;end
|
||||
|
@ -31,8 +31,9 @@ class Function # :nodoc: all
|
|||
f
|
||||
end
|
||||
end
|
||||
f = BigDecimal::limit(100)
|
||||
f = Function.new
|
||||
x = [f.zero,f.zero] # Initial values
|
||||
n = nlsolve(f,x)
|
||||
p x
|
||||
|
||||
f = BigDecimal.limit(100)
|
||||
f = Function.new
|
||||
x = [f.zero,f.zero] # Initial values
|
||||
n = nlsolve(f,x)
|
||||
p x
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue