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}
.clamp(min, max) ⇒ Decimal
+ min
: number|string|Decimal
+ max
: number|string|Decimal
+
See clampedTo
.
Decimal.clamp(10.1, 0, 10) // '10'+ + +
.clone([object]) ⇒ Decimal constructor
@@ -606,7 +620,7 @@ a.equals(b) // true
.max([x [, y, ...]]) ⇒ Decimal
+ max.max(x [, y, ...]) ⇒ Decimal
x
: number|string|Decimal
@@ -618,7 +632,7 @@ a.equals(b) // true
.min([x [, y, ...]]) ⇒ Decimal
+ min.min(x [, y, ...]) ⇒ Decimal
x
: number|string|Decimal
@@ -838,7 +852,7 @@ a.equals(b) // true
-
.sub(x, y) ⇒ Decimal
.sub(x, y) ⇒ Decimal
x
: number|string|Decimal
y
: number|string|Decimal
@@ -850,7 +864,26 @@ a.equals(b) // true
-
.tan(x) ⇒ Decimal
.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(x) ⇒ Decimal
x
: number|string|Decimal
See tangent
.
a = Decimal.tan(x) @@ -1249,6 +1282,28 @@ y.ceil() // '-1'+
.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'+ + +
.cmp(x) ⇒ number
x
: number|string|Decimal