@ -1,13 +1,12 @@
/*! decimal.js v10.0.2 https://github.com/MikeMcl/decimal.js/LICENCE */
; ( function ( globalScope ) {
; ( function ( globalScope ) {
'use strict' ;
'use strict' ;
/ *
/ *
* decimal . js v10 . 0.2
* decimal . js v10 . 1.0
* An arbitrary - precision Decimal type for JavaScript .
* An arbitrary - precision Decimal type for JavaScript .
* https : //github.com/MikeMcl/decimal.js
* https : //github.com/MikeMcl/decimal.js
* Copyright ( c ) 201 8 Michael Mclaughlin < M8ch88l @ gmail . com >
* Copyright ( c ) 201 9 Michael Mclaughlin < M8ch88l @ gmail . com >
* MIT Licence
* MIT Licence
* /
* /
@ -2112,7 +2111,6 @@
} ;
} ;
/ *
/ *
* Returns a new Decimal whose value is the nearest multiple of ` y ` in the direction of rounding
* Returns a new Decimal whose value is the nearest multiple of ` y ` in the direction of rounding
* mode ` rm ` , or ` Decimal.rounding ` if ` rm ` is omitted , to the value of this Decimal .
* mode ` rm ` , or ` Decimal.rounding ` if ` rm ` is omitted , to the value of this Decimal .
@ -4259,8 +4257,27 @@
// Duplicate.
// Duplicate.
if ( v instanceof Decimal ) {
if ( v instanceof Decimal ) {
x . s = v . s ;
x . s = v . s ;
if ( external ) {
if ( ! v . d || v . e > Decimal . maxE ) {
// Infinity.
x . e = NaN ;
x . d = null ;
} else if ( v . e < Decimal . minE ) {
// Zero.
x . e = 0 ;
x . d = [ 0 ] ;
} else {
x . e = v . e ;
x . d = v . d . slice ( ) ;
}
} else {
x . e = v . e ;
x . e = v . e ;
x . d = ( v = v . d ) ? v . slice ( ) : v ;
x . d = v . d ? v . d . slice ( ) : v . d ;
}
return ;
return ;
}
}
@ -4284,8 +4301,23 @@
// Fast path for small integers.
// Fast path for small integers.
if ( v === ~ ~ v && v < 1e7 ) {
if ( v === ~ ~ v && v < 1e7 ) {
for ( e = 0 , i = v ; i >= 10 ; i /= 10 ) e ++ ;
for ( e = 0 , i = v ; i >= 10 ; i /= 10 ) e ++ ;
if ( external ) {
if ( e > Decimal . maxE ) {
x . e = NaN ;
x . d = null ;
} else if ( e < Decimal . minE ) {
x . e = 0 ;
x . d = [ 0 ] ;
} else {
x . e = e ;
x . e = e ;
x . d = [ v ] ;
x . d = [ v ] ;
}
} else {
x . e = e ;
x . d = [ v ] ;
}
return ;
return ;
// Infinity, NaN.
// Infinity, NaN.
@ -4367,7 +4399,6 @@
Decimal . tanh = tanh ; // ES6
Decimal . tanh = tanh ; // ES6
Decimal . trunc = trunc ; // ES6
Decimal . trunc = trunc ; // ES6
if ( obj === void 0 ) obj = { } ;
if ( obj === void 0 ) obj = { } ;
if ( obj ) {
if ( obj ) {
if ( obj . defaults !== true ) {
if ( obj . defaults !== true ) {
@ -4810,9 +4841,11 @@
// Node and other environments that support module.exports.
// Node and other environments that support module.exports.
} else if ( typeof module != 'undefined' && module . exports ) {
} else if ( typeof module != 'undefined' && module . exports ) {
Decimal . prototype [ Symbol . for ( 'nodejs.util.inspect.custom' ) ] = function ( ) {
if ( Symbol && typeof Symbol . iterator == 'symbol' ) {
return this . toString ( ) ;
P [ Symbol . for ( 'nodejs.util.inspect.custom' ) ] = P . toString ;
} ;
P [ Symbol . toStringTag ] = 'Decimal' ;
}
module . exports = Decimal ;
module . exports = Decimal ;
// Browser.
// Browser.