mirror of
https://github.com/MikeMcl/decimal.js.git
synced 2026-09-23 04:14:32 +00:00
#128 Accept + prefix
This commit is contained in:
12
decimal.mjs
12
decimal.mjs
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* decimal.js v10.1.1
|
||||
* decimal.js v10.2.0
|
||||
* An arbitrary-precision Decimal type for JavaScript.
|
||||
* https://github.com/MikeMcl/decimal.js
|
||||
* Copyright (c) 2019 Michael Mclaughlin <M8ch88l@gmail.com>
|
||||
@@ -3728,7 +3728,7 @@ function tinyPow(b, e) {
|
||||
var n = b;
|
||||
while (--e) n *= b;
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return the absolute value of `x` reduced to less than or equal to half pi.
|
||||
@@ -4337,10 +4337,12 @@ function clone(obj) {
|
||||
}
|
||||
|
||||
// Minus sign?
|
||||
if (v.charCodeAt(0) === 45) {
|
||||
if ((i = v.charCodeAt(0)) === 45) {
|
||||
v = v.slice(1);
|
||||
x.s = -1;
|
||||
} else {
|
||||
// Plus sign?
|
||||
if (i === 43) v = v.slice(1);
|
||||
x.s = 1;
|
||||
}
|
||||
|
||||
@@ -4457,6 +4459,8 @@ function floor(x) {
|
||||
*
|
||||
* hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)
|
||||
*
|
||||
* arguments {number|string|Decimal}
|
||||
*
|
||||
*/
|
||||
function hypot() {
|
||||
var i, n,
|
||||
@@ -4731,6 +4735,8 @@ function round(x) {
|
||||
* -0 if x is -0,
|
||||
* NaN otherwise
|
||||
*
|
||||
* x {number|string|Decimal}
|
||||
*
|
||||
*/
|
||||
function sign(x) {
|
||||
x = new this(x);
|
||||
|
||||
Reference in New Issue
Block a user