From 62acad914e81f79ebfe02727b7fa7e8e3c215a05 Mon Sep 17 00:00:00 2001 From: shigek Date: Tue, 19 Aug 2003 14:21:13 +0000 Subject: to_s("+") implemented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/bigdecimal/bigdecimal_en.html | 47 +++++++++------------------------------ 1 file changed, 11 insertions(+), 36 deletions(-) (limited to 'ext/bigdecimal/bigdecimal_en.html') diff --git a/ext/bigdecimal/bigdecimal_en.html b/ext/bigdecimal/bigdecimal_en.html index d37d13616f..1197be15b9 100644 --- a/ext/bigdecimal/bigdecimal_en.html +++ b/ext/bigdecimal/bigdecimal_en.html @@ -1,3 +1,4 @@ + @@ -105,7 +106,8 @@ For details,see the util.rb code. a=BigDecimal::new(s[,n]) or
a=BigDecimal(s[,n]) or
where:
-s: Initial value string.
+s: Initial value string. Spaces will be ignored. Any unrecognizable character for +representing initial value terminates the string.
n: Maximum number of significant digits of a. n must be a Fixnum object. If n is omitted or is equal to 0,then the maximum number of significant digits of a is determined from the length of s. Actual number of digits handled in computations are usually gretaer than n.
@@ -373,6 +375,14 @@ n can be an string representing a positive integer number.
 BigDecimal("0.1234567890123456789").to_s("10") #  ==> "0.1234567890 123456789E0"
 
+If the first character is '+'(or ' '),then '+'(or ' ') will be set before value string +when the value is positive. +
+BigDecimal("0.1234567890123456789").to_s(" 10") #  ==> " 0.1234567890 123456789E0"
+BigDecimal("0.1234567890123456789").to_s("+10") #  ==> "+0.1234567890 123456789E0"
+BigDecimal("-0.1234567890123456789").to_s("10") #  ==> "-0.1234567890 123456789E0"
+
+ At the end of the string,'E'(or 'e') or 'F'(or 'f') can be specified to change number representation.
@@ -501,42 +511,7 @@ same as ==,used in case statement.
 
  • >=
  • -

    Class methods(trial version)

    -Following class methods are in trial stage, and not usable in default. -Uncomment /* #define ENABLE_TRIAL_METHOD */ in bigdecimal.c, compile and install -again if you want to use. -
      -
    • E
    • -e = BigDecimal::E(n)
      -where e(=2.718281828....) is the base value of natural logarithm.
      -n specifies the length of significant digits of e. - -
      -
    • PI
    • -e = BigDecimal::PI(n)
      -returns at least n digits of the ratio of the circumference of a circle to its diameter -(pi=3.14159265358979....) using J.Machin's formula.
      -
      -
    - -

    Instance methods(trial version)

    -Following instance methods are in trial stage, and not usable in default. -Uncomment /* #define ENABLE_TRIAL_METHOD */ in bigdecimal.c, compile and install -again if you want to use. -
      -
    • sincos
    • -computes and returns sine and cosine value of a with significant digit number n at least.
      -sin,cos = a.sincos(n)
      -Computation may return bad results unless |a|<2*3.1415..... -
      -
    • exp
    • -c = a.exp(n)
      -computes the base of natural logarithm value(e=2.718281828....) powered by a -with significant digit number n at least.
      -
      -

    -

    About 'coerce'

    For the binary operation like A op B:
    -- cgit v1.2.3