diff --git a/ext/bigdecimal/bigdecimal_en.html b/ext/bigdecimal/bigdecimal_en.html index c2b86faef6..82acd2a2a5 100644 --- a/ext/bigdecimal/bigdecimal_en.html +++ b/ext/bigdecimal/bigdecimal_en.html @@ -1,4 +1,3 @@ - @@ -43,7 +42,7 @@ For the details about Ruby see:
NOTE:
This software is provided "AS IS" and without any express or implied warranties,including,without limitation,the implied - warranties of merchantibility and fitness for a particular + warranties of merchantability and fitness for a particular purpose. For the details,see COPYING and README included in this distribution.
@@ -115,7 +114,7 @@ s: Initial value string. Spaces will be ignored. Any unrecognizable character fo 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.
+Actual number of digits handled in computations are usually greater than n.
n is useful when performing divisions like
 BigDecimal("1")    / BigDecimal("3")    # => 0.3333333333 33E0
@@ -141,11 +140,11 @@ f = BigDecimal::mode(BigDecimal::EXCEPTION_ZERODIVIDE,flag)
f = BigDecimal::mode(BigDecimal::EXCEPTION_ALL,flag)
EXCEPTION_NaN controls the execution when computation results to NaN.
-EXCEPTION_INFINITY controls the execution when computation results to Infinity(}Infinity).
+EXCEPTION_INFINITY controls the execution when computation results to Infinity.
EXCEPTION_UNDERFLOW controls the execution when computation underflows.
EXCEPTION_OVERFLOW controls the execution when computation overflows.
-EXCEPTION_ZERODIVIDE controls the execution when zero-division occures.
-EXCEPTION_ALL controls the execution for any exception defined occures.
+EXCEPTION_ZERODIVIDE controls the execution when zero-division occurs.
+EXCEPTION_ALL controls the execution when any defined exception occurs.
If the flag is true,then the relating exception is thrown.
No exception is thrown when the flag is false(default) and computation continues with the result:
@@ -181,7 +180,7 @@ where flag must be one of: New rounding mode is returned. If nil is specified for the second argument,then current setting is returned.
The digit location for rounding operation can not be specified by this mode method, -use truncate/round/ceil/floor/add/sub/mult/div mthods for each instance instead. +use truncate/round/ceil/floor/add/sub/mult/div methods for each instance instead.
  • limit[(n)]
  • @@ -321,7 +320,7 @@ If n<0,then the n-th digit counted from the decimal point in integer part is pro
  • round[(n[,b])]
  • c = a.round
    -round a to the nearest 1(default)D
    +round a to the nearest 1(default)ÅD
      c = BigDecimal("1.23456").round  #  ==> 1
      c = BigDecimal("-1.23456").round #  ==> -1
    @@ -346,7 +345,7 @@ c = BigDecimal::new("1.23356").round(3,BigDecimal::ROUND_HALF_EVEN)   #  ==> 1.2
     
  • truncate[(n)]
  • c = a.truncate
    -truncate a to the nearest 1D
    +truncate a to the nearest 1ÅD
    As shown in the following example,an optional integer argument (n) specifying the position of the target digit can be given.
    If n>0,then the (n+1)th digit counted from the decimal point in fraction part is processed(resulting number of fraction part digits is less than or equal to n).
    @@ -409,7 +408,7 @@ means a = 0.xxxxxxx*10**n.
  • precs
  • n,m = a.precs
    -prec returns number of significant digits (n) and maximum number of +precs returns number of significant digits (n) and maximum number of significant digits (m) of a.
    @@ -439,11 +438,11 @@ a.nan? returns True when a is NaN.
  • infinite?
  • -a.infinite? returns 1 when a is +,-1 when a is -, nil otherwise. +a.infinite? returns 1 when a is Infinity, -1 when a is -Infinity, nil otherwise.
  • finite?
  • -a.finite? returns true when a is neither nor NaN. +a.finite? returns true when a is neither Infinity nor NaN.
  • zero?
  • @@ -526,9 +525,9 @@ same as ==,used in case statement.
    1.Both A and B are BigDecimal objects
    A op B is normally performed.
    2.A is the BigDecimal object but B is other than BigDecimal object
    -
    Operation is performed,after B is translated to correcponding BigDecimal object(because BigDecimal supports coerce method).
    +
    Operation is performed,after B is translated to corresponding BigDecimal object(because BigDecimal supports coerce method).
    3.A is not the BigDecimal object but B is BigDecimal object
    -
    If A has coerce mthod,then B will translate A to corresponding +
    If A has coerce method,then B will translate A to corresponding BigDecimal object and the operation is performed,otherwise an error occures.
    @@ -573,7 +572,7 @@ Zero has two different variations as +0.0 and -0.0. But,still, +0.0==-0.0 is true.

    Computation results including Infinity,NaN,+0.0 or -0.0 become complicated. -Run following program and comfirm the results. +Run following program and confirm the results. Send me any incorrect result if you find.
    @@ -603,12 +602,9 @@ where 'x' is any digit representing mantissa(kept in the array frac[]),
     BASE is base value(=10000 in 32 bit integer system),
     and n is the exponent value.
    Larger BASE value enables smaller size of the array frac[],and increases computation speed. -The value of BASE is defined ind VpInit(). In 32 bit integer system,this value is -10000. In 64 bit integer system,the value becomes larger. -BigDecimal has not yet been compiled and tested on 64 bit integer system. -It will be very nice if anyone try to run BigDecimal on 64 bit system and - inform me the results. -When BASE is 10000,an element of the array frac[] can have vale of from 0 to 9999. +The value of BASE is defined ind VpInit(). In 32 bit integer system, this value is +10000. In 64 bit integer system, the value is 1000000000. +When BASE is 10000,an element of the array frac[] can have value of from 0 to 9999. (up to 4 digits).
    The structure Real is defined in bigdecimal.h as:
    @@ -626,7 +622,7 @@ The structure Real is defined in bigdecimal.h as:
    /* -3 : -Infinity */ unsigned short flag; /* Control flag */ int exponent; /* Exponent value(0.xxxx*BASE**exponent) */ - unsigned long frac[1]; /* An araay holding mantissa(Variable) */ + unsigned long frac[1]; /* An array holding mantissa(Variable) */ } Real;
    The decimal value 1234.56784321 is represented as(BASE=10000):
    @@ -668,7 +664,7 @@ For example, 0.1 can not exactly be represented in binary.
    where b1=0,b2=0,b3=0,b4=1...
    bn(n=1,2,3,...) is infinite series of digit with value of 0 or 1, and rounding operation is necessary but where we should round the series ? -Of cource,exact "0.1" is printed if the rouding operation is properly done, +Of course, exact "0.1" is printed if the rounding operation is properly done,
    Significant digit we can have is automatically determined
    In binary representation,0.1 can not be represented in finite series of digit. @@ -678,12 +674,12 @@ structure.

    Disadvantage of decimal representation

    -Because most computers have no internal decimal representaion. +Because most computers have no internal decimal representation. Once you use BigDecimal,you need to keep using it without considering computation cost if exact computation is required.

    Which is the first input?

    -Because most people uses decimal notatin for numeric data representation, +Because most people uses decimal notation for numeric data representation, BigDecimal can handle numeric data without loss of translation error.
    @@ -701,11 +697,11 @@ significant digits of both side of the operator. For / ,resulting number of sign maximum significant digits of both side of the operator.
    1.2 For + and -,resulting number of significant digits is determined so that no round operation is needed.
    -For example, c has more than 100 siginificant digits if c is computed as:
    +For example, c has more than 100 significant digits if c is computed as:
    c = 0.1+0.1*10**(-100)

    As +,-,and * are always exact(no round operation is performed unless BigDecimal.limit is specified), -which means more momories are required to keep computation results. +which means more memory is required to keep computation results. But,the division such as c=1.0/3.0 will always be rounded.

    2. add,sub,mult,div

    @@ -729,7 +725,7 @@ decimal point.

    4. Example

    Following example compute the ratio of the circumference of a circle to -its dirmeter(pi=3.14159265358979....) using J.Machin's formula. +its diameter(pi=3.14159265358979....) using J.Machin's formula.

     #!/usr/local/bin/ruby