From 5d8f3617e0528ca169c7c6bf32833c9cc9afbe5a Mon Sep 17 00:00:00 2001 From: shigek Date: Fri, 1 Aug 2003 04:48:32 +0000 Subject: Specs adjusted for FLoat. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/bigdecimal/bigdecimal_en.html | 42 ++++++++++----------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) (limited to 'ext/bigdecimal/bigdecimal_en.html') 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)
For the resulting number of significant digits of c,see Resulting number of significant digits. -
  • add
  • +
  • add(b,n)
  • c = a.add(b,n)
    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.
    -
  • sub
  • +
  • sub(b,n)
  • c = a.sub(b,n)
    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.
    -
  • mult
  • +
  • mult(b,n)
  • c = a.mult(b,n)
    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.
    -
  • div
  • +
  • div(b[,n])
  • c = a.div(b,n)
    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.
    +If n is not given,then the result will be an integer(BigDecimal) like Float#div.
    -
  • %
  • -r = a%b
    -is the same as:
    -r = a-((a/b).floor)*b
    -
  • fix
  • c = a.fix
    returns integer part of a.
    @@ -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 - -
    -
  • divmod
  • -c,r = a.divmod(b) # a = c*b + r
    -returns the quotient and remainder of a/b.
    -a = c * b + r is always satisfied.
    -where c is the integer satisfying -c = (a/b).floor
    -and,therefore -r = a - c*b
    - -
    -
  • remainder
  • -r=a.remainder(b)
    -returns the remainder of a/b.
    -where c is the integer satisfying -c = (a/b).fix
    -and,therefore: -r = a - c*b
    -
  • abs
  • c = a.abs
    @@ -483,6 +458,11 @@ The same as ** method.
    c = a.power(n)
    returns the value of a powered by n(c=a**n). n must be an integer.
    +
    + +
  • divmod,quo,modulo,%,remainder
  • +See,corresponding methods in Float class. +
  • <=>
  • -- cgit v1.2.3