summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/sample/linear.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-02 15:10:13 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-02 15:10:13 +0000
commit1cc709a84a8afc8942096535c66289d04dfa2d7f (patch)
treeff04852d83425bd1511e39b66f0f05c4b2b493d4 /ext/bigdecimal/sample/linear.rb
parent72385b042df0c69d0d74cf998eaf959f0db9b904 (diff)
* 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
Diffstat (limited to 'ext/bigdecimal/sample/linear.rb')
-rw-r--r--ext/bigdecimal/sample/linear.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/bigdecimal/sample/linear.rb b/ext/bigdecimal/sample/linear.rb
index 93d558b539a..a33255f591e 100644
--- a/ext/bigdecimal/sample/linear.rb
+++ b/ext/bigdecimal/sample/linear.rb
@@ -16,8 +16,8 @@ require "bigdecimal/ludcmp"
#
# NOTE:
-# Change following BigDecimal::limit() if needed.
-BigDecimal::limit(100)
+# Change following BigDecimal.limit() if needed.
+BigDecimal.limit(100)
#
include LUSolve
@@ -27,8 +27,8 @@ def rd_order(na)
end
na = ARGV.size
-zero = BigDecimal::new("0.0")
-one = BigDecimal::new("1.0")
+zero = BigDecimal.new("0.0")
+one = BigDecimal.new("1.0")
while (n=rd_order(na))>0
a = []
@@ -40,10 +40,10 @@ while (n=rd_order(na))>0
for i in 0...n do
for j in 0...n do
printf("A[%d,%d]? ",i,j); s = ARGF.gets
- a << BigDecimal::new(s);
- as << BigDecimal::new(s);
+ a << BigDecimal.new(s);
+ as << BigDecimal.new(s);
end
- printf("Contatant vector element b[%d] ? ",i); b << BigDecimal::new(ARGF.gets);
+ printf("Contatant vector element b[%d] ? ",i); b << BigDecimal.new(ARGF.gets);
end
else
# Read data from specified file.
@@ -53,10 +53,10 @@ while (n=rd_order(na))>0
printf("%d) %s",i,s)
s = s.split
for j in 0...n do
- a << BigDecimal::new(s[j]);
- as << BigDecimal::new(s[j]);
+ a << BigDecimal.new(s[j]);
+ as << BigDecimal.new(s[j]);
end
- b << BigDecimal::new(s[n]);
+ b << BigDecimal.new(s[n]);
end
end
x = lusolve(a,b,ludecomp(a,n,zero,one),zero)