summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/bigdecimal_ja.html
diff options
context:
space:
mode:
authorshigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-06 13:18:26 +0000
committershigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-06 13:18:26 +0000
commit3f8d7303c18a9a3de1438dfa7299d2e71bbab031 (patch)
treebf64e39293d6151047caf85e2b72fe0fbc2f9d30 /ext/bigdecimal/bigdecimal_ja.html
parent273a14a44cd790874e94bb7335eeea687477fe3e (diff)
bigdecimal-brushup.patch from Tadashi Saito applied.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/bigdecimal_ja.html')
-rw-r--r--ext/bigdecimal/bigdecimal_ja.html21
1 files changed, 10 insertions, 11 deletions
diff --git a/ext/bigdecimal/bigdecimal_ja.html b/ext/bigdecimal/bigdecimal_ja.html
index e9fa7a0906..efd4228d9a 100644
--- a/ext/bigdecimal/bigdecimal_ja.html
+++ b/ext/bigdecimal/bigdecimal_ja.html
@@ -303,12 +303,11 @@ a が Infinity や NaN のとき、i は nil になります。
<LI>to_f</LI><BR>
dup と全く同じです。
同じ値の BigDecimal オブジェクトを生成します。
-<LI>to_s</LI><BR>
+<LI>to_s[(n)]</LI><BR>
文字列に変換します("0.xxxxxEn"の形になります)。<BR>
-s = a.to_s
-<LI>to_s2</LI><BR>
-文字列に変換します。仮数部分を n 桁毎に空白で区切ります。<BR>
-s = a.to_s2(n)
+s = a.to_s<BR>
+n が指定されたときは、仮数部分を n 桁毎に空白で区切ります。<BR>
+s = a.to_s(n)
<LI>exponent</LI><BR>
指数部を整数値で返します。
n = a.exponent <BR>
@@ -644,17 +643,17 @@ c = a op b という計算(op は + - * /)をしたときの動作は
#!/usr/local/bin/ruby
#
-# pai.rb
-# USAGE: ruby pai.rb n
+# pi.rb
+# USAGE: ruby pi.rb n
# where n is the number of digits required.
-# EX.: ruby pai.rb 1000
+# EX.: ruby pi.rb 1000
#
require "bigdecimal"
#
# Calculates 3.1415.... using J. Machin's formula.
#
-def pai(sig) # sig: Number of significant figures
+def big_pi(sig) # sig: Number of significant figures
exp = -sig
pi = BigDecimal::new("0")
two = BigDecimal::new("2")
@@ -686,8 +685,8 @@ def pai(sig) # sig: Number of significant figures
end
if $0 == __FILE__
- print "PAI("+ARGV[0]+"):\n"
- p pai(ARGV[0].to_i)
+ print "PI("+ARGV[0]+"):\n"
+ p pi(ARGV[0].to_i)
end
</PRE></CODE>