diff options
author | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-01 04:48:32 +0000 |
---|---|---|
committer | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-01 04:48:32 +0000 |
commit | 5d8f3617e0528ca169c7c6bf32833c9cc9afbe5a (patch) | |
tree | 5c63ca042f523167b9da2d465358b8d76b9df6b8 /ext/bigdecimal/bigdecimal_en.html | |
parent | fd5bdcd21cf4b691a5c9965618323610d83f50da (diff) | |
download | ruby-5d8f3617e0528ca169c7c6bf32833c9cc9afbe5a.tar.gz |
Specs adjusted for FLoat.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/bigdecimal_en.html')
-rw-r--r-- | ext/bigdecimal/bigdecimal_en.html | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/ext/bigdecimal/bigdecimal_en.html b/ext/bigdecimal/bigdecimal_en.html index 2d86adcc6b..a8ced21e01 100644 --- a/ext/bigdecimal/bigdecimal_en.html +++ b/ext/bigdecimal/bigdecimal_en.html @@ -233,40 +233,35 @@ division(c = a / b)<BR> For the resulting number of significant digits of c,see <A HREF="#PREC">Resulting number of significant digits</A>. </BLOCKQUOTE> -<LI><B>add</B></LI><BLOCKQUOTE> +<LI><B>add(b,n)</B></LI><BLOCKQUOTE> c = a.add(b,n)<BR> c = a.add(b,n) performs c = a + b. If n is less than the actual significant digits of a + b, then c is rounded properly according to the BigDecimal.limit. </BLOCKQUOTE> -<LI><B>sub</B></LI><BLOCKQUOTE> +<LI><B>sub(b,n)</B></LI><BLOCKQUOTE> c = a.sub(b,n)<BR> c = a.sub(b,n) performs c = a - b. If n is less than the actual significant digits of a - b, then c is rounded properly according to the BigDecimal.limit. </BLOCKQUOTE> -<LI><B>mult</B></LI><BLOCKQUOTE> +<LI><B>mult(b,n)</B></LI><BLOCKQUOTE> c = a.mult(b,n)<BR> c = a.mult(b,n) performs c = a * b. If n is less than the actual significant digits of a * b, then c is rounded properly according to the BigDecimal.limit. </BLOCKQUOTE> -<LI><B>div</B></LI><BLOCKQUOTE> +<LI><B>div(b[,n])</B></LI><BLOCKQUOTE> c = a.div(b,n)<BR> c = a.div(b,n) performs c = a / b. If n is less than the actual significant digits of a / b, -then c is rounded properly according to the BigDecimal.limit. - +then c is rounded properly according to the BigDecimal.limit.<BR> +If n is not given,then the result will be an integer(BigDecimal) like Float#div. </BLOCKQUOTE> -<LI><B>%</B></LI><BLOCKQUOTE> -r = a%b <BR> -is the same as:<BR> -r = a-((a/b).floor)*b<BR> -</BLOCKQUOTE> <LI><B>fix</B></LI><BLOCKQUOTE> c = a.fix<BR> returns integer part of a.<BR> @@ -350,26 +345,6 @@ If n<0,then the n-th digit counted from the decimal point in integer part is pro c = BigDecimal::new("1.23456").truncate(4) # ==> 1.2345 c = BigDecimal::new("15.23456").truncate(-1) # ==> 10.0 </PRE></CODE> - -</BLOCKQUOTE> -<LI><B>divmod</B></LI><BLOCKQUOTE> -c,r = a.divmod(b) # a = c*b + r<BR> -returns the quotient and remainder of a/b.<BR> -a = c * b + r is always satisfied.<BR> -where c is the integer satisfying -c = (a/b).floor <BR> -and,therefore -r = a - c*b<BR> - -</BLOCKQUOTE> -<LI><B>remainder</B></LI><BLOCKQUOTE> -r=a.remainder(b)<BR> -returns the remainder of a/b.<BR> -where c is the integer satisfying -c = (a/b).fix <BR> -and,therefore: -r = a - c*b<BR> - </BLOCKQUOTE> <LI><B>abs</B></LI><BLOCKQUOTE> c = a.abs<BR> @@ -483,6 +458,11 @@ The same as ** method.<BR> c = a.power(n)<BR> returns the value of a powered by n(c=a**n). n must be an integer.<BR> +</BLOCKQUOTE> + +<LI><B>divmod,quo,modulo,%,remainder</B></LI><BLOCKQUOTE> +See,corresponding methods in Float class. +</BLOCKQUOTE> </BLOCKQUOTE> <LI><B><=></B></LI><BLOCKQUOTE> |