diff --git a/API.png b/API.png index fe1937d..8038935 100644 Binary files a/API.png and b/API.png differ diff --git a/index.html b/index.html index 6ea2cb0..a61553b 100644 --- a/index.html +++ b/index.html @@ -76,6 +76,7 @@ li span{float:right;margin-right:10px;color:#c0c0c0}
  • atan2
  • cbrt
  • ceil
  • +
  • clamp
  • clone
  • cos
  • cosh
  • @@ -102,6 +103,7 @@ li span{float:right;margin-right:10px;color:#c0c0c0}
  • sinh
  • sqrt
  • sub
  • +
  • sum
  • tan
  • tanh
  • trunc
  • @@ -137,6 +139,7 @@ li span{float:right;margin-right:10px;color:#c0c0c0}
  • absoluteValue abs
  • ceil
  • comparedTo cmp
  • +
  • clampedTo clamp
  • cosine cos
  • cubeRoot cbrt
  • decimalPlaces dp
  • @@ -303,6 +306,7 @@ new Decimal('0xff.8') // '255.5' new Decimal(0.046875) // '0.046875' new Decimal('0.046875000000') // '0.046875' +new Decimal('0.046_875_000_000') // '0.046875' new Decimal(4.6875e-2) // '0.046875' new Decimal('468.75e-4') // '0.046875' @@ -441,6 +445,16 @@ a.equals(b) // true +
    clamp.clamp(min, max) ⇒ Decimal
    +

    + min: number|string|Decimal
    + max: number|string|Decimal +

    +

    See clampedTo.

    +
    Decimal.clamp(10.1, 0, 10)     // '10'
    + + +
    clone .clone([object]) ⇒ Decimal constructor @@ -606,7 +620,7 @@ a.equals(b) // true
    - max.max([x [, y, ...]]) ⇒ Decimal + max.max(x [, y, ...]) ⇒ Decimal

    x: number|string|Decimal
    @@ -618,7 +632,7 @@ a.equals(b) // true

    - min.min([x [, y, ...]]) ⇒ Decimal + min.min(x [, y, ...]) ⇒ Decimal

    x: number|string|Decimal
    @@ -838,7 +852,7 @@ a.equals(b) // true -

    sub.sub(x, y) ⇒ Decimal
    +
    sub.sub(x, y) ⇒ Decimal

    x: number|string|Decimal
    y: number|string|Decimal @@ -850,7 +864,26 @@ a.equals(b) // true -

    tan.tan(x) ⇒ Decimal
    +
    sum.sum(x [, y, ...]) ⇒ Decimal
    +

    + x: number|string|Decimal
    + y: number|string|Decimal +

    +

    + Returns a new Decimal whose value is the sum of the arguments, + rounded to precision significant digits using + rounding mode rounding.
    + Only the result is rounded, not the intermediate summations. +

    +
    +x = 5
    +y = '16'
    +z = new Decimal(-11)
    +Decimal.sum(x, y, z)           // '10'
    + + + +
    tan.tan(x) ⇒ Decimal

    x: number|string|Decimal

    See tangent.

    a = Decimal.tan(x)
    @@ -1249,6 +1282,28 @@ y.ceil()                      // '-1'
    +
    clampedTo.clamp(min, max) ⇒ Decimal
    +

    + min: number|string|Decimal
    + max: number|string|Decimal +

    +

    + Returns a new Decimal whose value is the value of this Decimal clamped to the range + delineated by min and max. +

    +

    + The return value is not affected by the value of the + precision setting. +

    +
    +x = new Decimal(5)
    +min = new Decimal(100)
    +max = new Decimal(Infinity)
    +x.clampedTo(min, max)         // '100'
    +x.clamp(-10, -0.1)            // '-0.1'
    + + +
    comparedTo.cmp(x) ⇒ number

    x: number|string|Decimal

    @@ -1618,10 +1673,6 @@ x = new Decimal(1) x.isFinite() // true y = new Decimal(Infinity) y.isFinite() // false -

    - Note: The native method isFinite() can be used if - n <= Number.MAX_VALUE. -

    @@ -1648,7 +1699,6 @@ x = new Decimal(NaN) x.isNaN() // true y = new Decimal('Infinity') y.isNaN() // false -

    Note: The native method isNaN() can also be used.

    @@ -1662,7 +1712,14 @@ x = new Decimal(-0) x.isNegative() // true y = new Decimal(2) y.isNeg // false -

    Note: n < 0 can be used if n <= -Number.MIN_VALUE.

    +

    Note that zero is signed.

    +
    +new Decimal(0).valueOf()                 // '0'
    +new Decimal(0).isNegative()              // false
    +new Decimal(0).negated().valueOf()       // '-0'
    +new Decimal(0).negated().isNegative()    // true
    +new Decimal(-0).isNegative()             // true
    +    
    @@ -1676,7 +1733,6 @@ x = new Decimal(0) x.isPositive() // true y = new Decimal(-2) y.isPos // false -

    Note: n < 0 can be used if n <= -Number.MIN_VALUE.

    @@ -1690,7 +1746,6 @@ x = new Decimal(-0) x.isZero() && x.isNeg() // true y = new Decimal(Infinity) y.isZero() // false -

    Note: n == 0 can be used if n >= Number.MIN_VALUE.

    @@ -2393,8 +2448,8 @@ x.toPrecision() // '45.6' y.toPrecision() // '45.6' x.toPrecision(1) // '5e+1' y.toPrecision(1) // '5e+1' -y.toPrecision(2, Decimal.ROUND_UP) // '4.6e+1' -y.toPrecision(2, Decimal.DOWN) // '4.5e+1' +y.toPrecision(2, Decimal.ROUND_UP) // '46' +y.toPrecision(2, Decimal.ROUND_DOWN) // '45' x.toPrecision(5) // '45.600' y.toPrecision(5) // '45.600' @@ -2680,9 +2735,8 @@ z = x.multiply(y) // 4.1400000 -