BigNumber.js 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330
  1. (function() {
  2. /* bignumber.js v4.0.0 https://github.com/MikeMcl/bignumber.js/LICENCE */
  3. !(function(e) {
  4. 'use strict';
  5. function n(e) {
  6. function a(e, n) {
  7. var t,
  8. r,
  9. i,
  10. o,
  11. u,
  12. s,
  13. l = this;
  14. if (!(l instanceof a))
  15. return z && x(26, 'constructor call without new', e), new a(e, n);
  16. if (null != n && V(n, 2, 64, C, 'base')) {
  17. if (((n = 0 | n), (s = e + ''), 10 == n))
  18. return (l = new a(e instanceof a ? e : s)), I(l, B + l.e + 1, P);
  19. if (
  20. ((o = 'number' == typeof e) && 0 * e != 0) ||
  21. !new RegExp(
  22. '^-?' + (t = '[' + v.slice(0, n) + ']+') + '(?:\\.' + t + ')?$',
  23. 37 > n ? 'i' : ''
  24. ).test(s)
  25. )
  26. return U(l, s, o, n);
  27. o
  28. ? ((l.s = 0 > 1 / e ? ((s = s.slice(1)), -1) : 1),
  29. z && s.replace(/^0\.0*|\./, '').length > 15 && x(C, w, e),
  30. (o = !1))
  31. : (l.s = 45 === s.charCodeAt(0) ? ((s = s.slice(1)), -1) : 1),
  32. (s = A(s, 10, n, l.s));
  33. } else {
  34. if (e instanceof a)
  35. return (
  36. (l.s = e.s),
  37. (l.e = e.e),
  38. (l.c = (e = e.c) ? e.slice() : e),
  39. void (C = 0)
  40. );
  41. if ((o = 'number' == typeof e) && 0 * e == 0) {
  42. if (((l.s = 0 > 1 / e ? ((e = -e), -1) : 1), e === ~~e)) {
  43. for (r = 0, i = e; i >= 10; i /= 10, r++);
  44. return (l.e = r), (l.c = [e]), void (C = 0);
  45. }
  46. s = e + '';
  47. } else {
  48. if (!h.test((s = e + ''))) return U(l, s, o);
  49. l.s = 45 === s.charCodeAt(0) ? ((s = s.slice(1)), -1) : 1;
  50. }
  51. }
  52. for (
  53. (r = s.indexOf('.')) > -1 && (s = s.replace('.', '')),
  54. (i = s.search(/e/i)) > 0
  55. ? (0 > r && (r = i),
  56. (r += +s.slice(i + 1)),
  57. (s = s.substring(0, i)))
  58. : 0 > r && (r = s.length),
  59. i = 0;
  60. 48 === s.charCodeAt(i);
  61. i++
  62. );
  63. for (u = s.length; 48 === s.charCodeAt(--u); );
  64. if ((s = s.slice(i, u + 1)))
  65. if (
  66. ((u = s.length),
  67. o && z && u > 15 && (e > y || e !== p(e)) && x(C, w, l.s * e),
  68. (r = r - i - 1),
  69. r > G)
  70. )
  71. l.c = l.e = null;
  72. else if ($ > r) l.c = [(l.e = 0)];
  73. else {
  74. if (
  75. ((l.e = r),
  76. (l.c = []),
  77. (i = (r + 1) % b),
  78. 0 > r && (i += b),
  79. u > i)
  80. ) {
  81. for (i && l.c.push(+s.slice(0, i)), u -= b; u > i; )
  82. l.c.push(+s.slice(i, (i += b)));
  83. (s = s.slice(i)), (i = b - s.length);
  84. } else i -= u;
  85. for (; i--; s += '0');
  86. l.c.push(+s);
  87. }
  88. else l.c = [(l.e = 0)];
  89. C = 0;
  90. }
  91. function A(e, n, t, i) {
  92. var o,
  93. u,
  94. l,
  95. c,
  96. h,
  97. g,
  98. p,
  99. d = e.indexOf('.'),
  100. m = B,
  101. w = P;
  102. for (
  103. 37 > t && (e = e.toLowerCase()),
  104. d >= 0 &&
  105. ((l = W),
  106. (W = 0),
  107. (e = e.replace('.', '')),
  108. (p = new a(t)),
  109. (h = p.pow(e.length - d)),
  110. (W = l),
  111. (p.c = s(f(r(h.c), h.e), 10, n)),
  112. (p.e = p.c.length)),
  113. g = s(e, t, n),
  114. u = l = g.length;
  115. 0 == g[--l];
  116. g.pop()
  117. );
  118. if (!g[0]) return '0';
  119. if (
  120. (0 > d
  121. ? --u
  122. : ((h.c = g),
  123. (h.e = u),
  124. (h.s = i),
  125. (h = L(h, p, m, w, n)),
  126. (g = h.c),
  127. (c = h.r),
  128. (u = h.e)),
  129. (o = u + m + 1),
  130. (d = g[o]),
  131. (l = n / 2),
  132. (c = c || 0 > o || null != g[o + 1]),
  133. (c =
  134. 4 > w
  135. ? (null != d || c) && (0 == w || w == (h.s < 0 ? 3 : 2))
  136. : d > l ||
  137. (d == l &&
  138. (4 == w ||
  139. c ||
  140. (6 == w && 1 & g[o - 1]) ||
  141. w == (h.s < 0 ? 8 : 7)))),
  142. 1 > o || !g[0])
  143. )
  144. e = c ? f('1', -m) : '0';
  145. else {
  146. if (((g.length = o), c))
  147. for (--n; ++g[--o] > n; ) (g[o] = 0), o || (++u, g.unshift(1));
  148. for (l = g.length; !g[--l]; );
  149. for (d = 0, e = ''; l >= d; e += v.charAt(g[d++]));
  150. e = f(e, u);
  151. }
  152. return e;
  153. }
  154. function E(e, n, t, i) {
  155. var o, u, s, c, h;
  156. if (((t = null != t && V(t, 0, 8, i, m) ? 0 | t : P), !e.c))
  157. return e.toString();
  158. if (((o = e.c[0]), (s = e.e), null == n))
  159. (h = r(e.c)),
  160. (h = 19 == i || (24 == i && q >= s) ? l(h, s) : f(h, s));
  161. else if (
  162. ((e = I(new a(e), n, t)),
  163. (u = e.e),
  164. (h = r(e.c)),
  165. (c = h.length),
  166. 19 == i || (24 == i && (u >= n || q >= u)))
  167. ) {
  168. for (; n > c; h += '0', c++);
  169. h = l(h, u);
  170. } else if (((n -= s), (h = f(h, u)), u + 1 > c)) {
  171. if (--n > 0) for (h += '.'; n--; h += '0');
  172. } else if (((n += u - c), n > 0))
  173. for (u + 1 == c && (h += '.'); n--; h += '0');
  174. return e.s < 0 && o ? '-' + h : h;
  175. }
  176. function D(e, n) {
  177. var t,
  178. r,
  179. i = 0;
  180. for (u(e[0]) && (e = e[0]), t = new a(e[0]); ++i < e.length; ) {
  181. if (((r = new a(e[i])), !r.s)) {
  182. t = r;
  183. break;
  184. }
  185. n.call(t, r) && (t = r);
  186. }
  187. return t;
  188. }
  189. function F(e, n, t, r, i) {
  190. return (
  191. (n > e || e > t || e != c(e)) &&
  192. x(
  193. r,
  194. (i || 'decimal places') +
  195. (n > e || e > t ? ' out of range' : ' not an integer'),
  196. e
  197. ),
  198. !0
  199. );
  200. }
  201. function _(e, n, t) {
  202. for (var r = 1, i = n.length; !n[--i]; n.pop());
  203. for (i = n[0]; i >= 10; i /= 10, r++);
  204. return (
  205. (t = r + t * b - 1) > G
  206. ? (e.c = e.e = null)
  207. : $ > t
  208. ? (e.c = [(e.e = 0)])
  209. : ((e.e = t), (e.c = n)),
  210. e
  211. );
  212. }
  213. function x(e, n, t) {
  214. var r = new Error(
  215. [
  216. 'new BigNumber',
  217. 'cmp',
  218. 'config',
  219. 'div',
  220. 'divToInt',
  221. 'eq',
  222. 'gt',
  223. 'gte',
  224. 'lt',
  225. 'lte',
  226. 'minus',
  227. 'mod',
  228. 'plus',
  229. 'precision',
  230. 'random',
  231. 'round',
  232. 'shift',
  233. 'times',
  234. 'toDigits',
  235. 'toExponential',
  236. 'toFixed',
  237. 'toFormat',
  238. 'toFraction',
  239. 'pow',
  240. 'toPrecision',
  241. 'toString',
  242. 'BigNumber'
  243. ][e] +
  244. '() ' +
  245. n +
  246. ': ' +
  247. t
  248. );
  249. throw ((r.name = 'BigNumber Error'), (C = 0), r);
  250. }
  251. function I(e, n, t, r) {
  252. var i,
  253. o,
  254. u,
  255. s,
  256. l,
  257. f,
  258. c,
  259. a = e.c,
  260. h = O;
  261. if (a) {
  262. e: {
  263. for (i = 1, s = a[0]; s >= 10; s /= 10, i++);
  264. if (((o = n - i), 0 > o))
  265. (o += b),
  266. (u = n),
  267. (l = a[(f = 0)]),
  268. (c = (l / h[i - u - 1]) % 10 | 0);
  269. else if (((f = g((o + 1) / b)), f >= a.length)) {
  270. if (!r) break e;
  271. for (; a.length <= f; a.push(0));
  272. (l = c = 0), (i = 1), (o %= b), (u = o - b + 1);
  273. } else {
  274. for (l = s = a[f], i = 1; s >= 10; s /= 10, i++);
  275. (o %= b),
  276. (u = o - b + i),
  277. (c = 0 > u ? 0 : (l / h[i - u - 1]) % 10 | 0);
  278. }
  279. if (
  280. ((r =
  281. r ||
  282. 0 > n ||
  283. null != a[f + 1] ||
  284. (0 > u ? l : l % h[i - u - 1])),
  285. (r =
  286. 4 > t
  287. ? (c || r) && (0 == t || t == (e.s < 0 ? 3 : 2))
  288. : c > 5 ||
  289. (5 == c &&
  290. (4 == t ||
  291. r ||
  292. (6 == t &&
  293. (o > 0 ? (u > 0 ? l / h[i - u] : 0) : a[f - 1]) %
  294. 10 &
  295. 1) ||
  296. t == (e.s < 0 ? 8 : 7)))),
  297. 1 > n || !a[0])
  298. )
  299. return (
  300. (a.length = 0),
  301. r
  302. ? ((n -= e.e + 1),
  303. (a[0] = h[(b - (n % b)) % b]),
  304. (e.e = -n || 0))
  305. : (a[0] = e.e = 0),
  306. e
  307. );
  308. if (
  309. (0 == o
  310. ? ((a.length = f), (s = 1), f--)
  311. : ((a.length = f + 1),
  312. (s = h[b - o]),
  313. (a[f] = u > 0 ? p((l / h[i - u]) % h[u]) * s : 0)),
  314. r)
  315. )
  316. for (;;) {
  317. if (0 == f) {
  318. for (o = 1, u = a[0]; u >= 10; u /= 10, o++);
  319. for (u = a[0] += s, s = 1; u >= 10; u /= 10, s++);
  320. o != s && (e.e++, a[0] == N && (a[0] = 1));
  321. break;
  322. }
  323. if (((a[f] += s), a[f] != N)) break;
  324. (a[f--] = 0), (s = 1);
  325. }
  326. for (o = a.length; 0 === a[--o]; a.pop());
  327. }
  328. e.e > G ? (e.c = e.e = null) : e.e < $ && (e.c = [(e.e = 0)]);
  329. }
  330. return e;
  331. }
  332. var L,
  333. U,
  334. C = 0,
  335. M = a.prototype,
  336. T = new a(1),
  337. B = 20,
  338. P = 4,
  339. q = -7,
  340. k = 21,
  341. $ = -1e7,
  342. G = 1e7,
  343. z = !0,
  344. V = F,
  345. j = !1,
  346. H = 1,
  347. W = 0,
  348. J = {
  349. decimalSeparator: '.',
  350. groupSeparator: ',',
  351. groupSize: 3,
  352. secondaryGroupSize: 0,
  353. fractionGroupSeparator: ' ',
  354. fractionGroupSize: 0
  355. };
  356. return (
  357. (a.another = n),
  358. (a.ROUND_UP = 0),
  359. (a.ROUND_DOWN = 1),
  360. (a.ROUND_CEIL = 2),
  361. (a.ROUND_FLOOR = 3),
  362. (a.ROUND_HALF_UP = 4),
  363. (a.ROUND_HALF_DOWN = 5),
  364. (a.ROUND_HALF_EVEN = 6),
  365. (a.ROUND_HALF_CEIL = 7),
  366. (a.ROUND_HALF_FLOOR = 8),
  367. (a.EUCLID = 9),
  368. (a.config = a.set = function() {
  369. var e,
  370. n,
  371. t = 0,
  372. r = {},
  373. i = arguments,
  374. s = i[0],
  375. l =
  376. s && 'object' == typeof s
  377. ? function() {
  378. return s.hasOwnProperty(n) ? null != (e = s[n]) : void 0;
  379. }
  380. : function() {
  381. return i.length > t ? null != (e = i[t++]) : void 0;
  382. };
  383. return (
  384. l((n = 'DECIMAL_PLACES')) && V(e, 0, S, 2, n) && (B = 0 | e),
  385. (r[n] = B),
  386. l((n = 'ROUNDING_MODE')) && V(e, 0, 8, 2, n) && (P = 0 | e),
  387. (r[n] = P),
  388. l((n = 'EXPONENTIAL_AT')) &&
  389. (u(e)
  390. ? V(e[0], -S, 0, 2, n) &&
  391. V(e[1], 0, S, 2, n) &&
  392. ((q = 0 | e[0]), (k = 0 | e[1]))
  393. : V(e, -S, S, 2, n) && (q = -(k = 0 | (0 > e ? -e : e)))),
  394. (r[n] = [q, k]),
  395. l((n = 'RANGE')) &&
  396. (u(e)
  397. ? V(e[0], -S, -1, 2, n) &&
  398. V(e[1], 1, S, 2, n) &&
  399. (($ = 0 | e[0]), (G = 0 | e[1]))
  400. : V(e, -S, S, 2, n) &&
  401. (0 | e
  402. ? ($ = -(G = 0 | (0 > e ? -e : e)))
  403. : z && x(2, n + ' cannot be zero', e))),
  404. (r[n] = [$, G]),
  405. l((n = 'ERRORS')) &&
  406. (e === !!e || 1 === e || 0 === e
  407. ? ((C = 0), (V = (z = !!e) ? F : o))
  408. : z && x(2, n + d, e)),
  409. (r[n] = z),
  410. l((n = 'CRYPTO')) &&
  411. (e === !0 || e === !1 || 1 === e || 0 === e
  412. ? e
  413. ? ((e = 'undefined' == typeof crypto),
  414. !e &&
  415. crypto &&
  416. (crypto.getRandomValues || crypto.randomBytes)
  417. ? (j = !0)
  418. : z
  419. ? x(2, 'crypto unavailable', e ? void 0 : crypto)
  420. : (j = !1))
  421. : (j = !1)
  422. : z && x(2, n + d, e)),
  423. (r[n] = j),
  424. l((n = 'MODULO_MODE')) && V(e, 0, 9, 2, n) && (H = 0 | e),
  425. (r[n] = H),
  426. l((n = 'POW_PRECISION')) && V(e, 0, S, 2, n) && (W = 0 | e),
  427. (r[n] = W),
  428. l((n = 'FORMAT')) &&
  429. ('object' == typeof e
  430. ? (J = e)
  431. : z && x(2, n + ' not an object', e)),
  432. (r[n] = J),
  433. r
  434. );
  435. }),
  436. (a.max = function() {
  437. return D(arguments, M.lt);
  438. }),
  439. (a.min = function() {
  440. return D(arguments, M.gt);
  441. }),
  442. (a.random = (function() {
  443. var e = 9007199254740992,
  444. n =
  445. (Math.random() * e) & 2097151
  446. ? function() {
  447. return p(Math.random() * e);
  448. }
  449. : function() {
  450. return (
  451. 8388608 * ((1073741824 * Math.random()) | 0) +
  452. ((8388608 * Math.random()) | 0)
  453. );
  454. };
  455. return function(e) {
  456. var t,
  457. r,
  458. i,
  459. o,
  460. u,
  461. s = 0,
  462. l = [],
  463. f = new a(T);
  464. if (
  465. ((e = null != e && V(e, 0, S, 14) ? 0 | e : B), (o = g(e / b)), j)
  466. )
  467. if (crypto.getRandomValues) {
  468. for (
  469. t = crypto.getRandomValues(new Uint32Array((o *= 2)));
  470. o > s;
  471. )
  472. (u = 131072 * t[s] + (t[s + 1] >>> 11)),
  473. u >= 9e15
  474. ? ((r = crypto.getRandomValues(new Uint32Array(2))),
  475. (t[s] = r[0]),
  476. (t[s + 1] = r[1]))
  477. : (l.push(u % 1e14), (s += 2));
  478. s = o / 2;
  479. } else if (crypto.randomBytes) {
  480. for (t = crypto.randomBytes((o *= 7)); o > s; )
  481. (u =
  482. 281474976710656 * (31 & t[s]) +
  483. 1099511627776 * t[s + 1] +
  484. 4294967296 * t[s + 2] +
  485. 16777216 * t[s + 3] +
  486. (t[s + 4] << 16) +
  487. (t[s + 5] << 8) +
  488. t[s + 6]),
  489. u >= 9e15
  490. ? crypto.randomBytes(7).copy(t, s)
  491. : (l.push(u % 1e14), (s += 7));
  492. s = o / 7;
  493. } else (j = !1), z && x(14, 'crypto unavailable', crypto);
  494. if (!j) for (; o > s; ) (u = n()), 9e15 > u && (l[s++] = u % 1e14);
  495. for (
  496. o = l[--s],
  497. e %= b,
  498. o && e && ((u = O[b - e]), (l[s] = p(o / u) * u));
  499. 0 === l[s];
  500. l.pop(), s--
  501. );
  502. if (0 > s) l = [(i = 0)];
  503. else {
  504. for (i = -1; 0 === l[0]; l.shift(), i -= b);
  505. for (s = 1, u = l[0]; u >= 10; u /= 10, s++);
  506. b > s && (i -= b - s);
  507. }
  508. return (f.e = i), (f.c = l), f;
  509. };
  510. })()),
  511. (L = (function() {
  512. function e(e, n, t) {
  513. var r,
  514. i,
  515. o,
  516. u,
  517. s = 0,
  518. l = e.length,
  519. f = n % R,
  520. c = (n / R) | 0;
  521. for (e = e.slice(); l--; )
  522. (o = e[l] % R),
  523. (u = (e[l] / R) | 0),
  524. (r = c * o + u * f),
  525. (i = f * o + (r % R) * R + s),
  526. (s = ((i / t) | 0) + ((r / R) | 0) + c * u),
  527. (e[l] = i % t);
  528. return s && e.unshift(s), e;
  529. }
  530. function n(e, n, t, r) {
  531. var i, o;
  532. if (t != r) o = t > r ? 1 : -1;
  533. else
  534. for (i = o = 0; t > i; i++)
  535. if (e[i] != n[i]) {
  536. o = e[i] > n[i] ? 1 : -1;
  537. break;
  538. }
  539. return o;
  540. }
  541. function r(e, n, t, r) {
  542. for (var i = 0; t--; )
  543. (e[t] -= i),
  544. (i = e[t] < n[t] ? 1 : 0),
  545. (e[t] = i * r + e[t] - n[t]);
  546. for (; !e[0] && e.length > 1; e.shift());
  547. }
  548. return function(i, o, u, s, l) {
  549. var f,
  550. c,
  551. h,
  552. g,
  553. d,
  554. m,
  555. w,
  556. v,
  557. y,
  558. O,
  559. R,
  560. S,
  561. A,
  562. E,
  563. D,
  564. F,
  565. _,
  566. x = i.s == o.s ? 1 : -1,
  567. L = i.c,
  568. U = o.c;
  569. if (!(L && L[0] && U && U[0]))
  570. return new a(
  571. i.s && o.s && (L ? !U || L[0] != U[0] : U)
  572. ? (L && 0 == L[0]) || !U
  573. ? 0 * x
  574. : x / 0
  575. : NaN
  576. );
  577. for (
  578. v = new a(x),
  579. y = v.c = [],
  580. c = i.e - o.e,
  581. x = u + c + 1,
  582. l ||
  583. ((l = N), (c = t(i.e / b) - t(o.e / b)), (x = (x / b) | 0)),
  584. h = 0;
  585. U[h] == (L[h] || 0);
  586. h++
  587. );
  588. if ((U[h] > (L[h] || 0) && c--, 0 > x)) y.push(1), (g = !0);
  589. else {
  590. for (
  591. E = L.length,
  592. F = U.length,
  593. h = 0,
  594. x += 2,
  595. d = p(l / (U[0] + 1)),
  596. d > 1 &&
  597. ((U = e(U, d, l)),
  598. (L = e(L, d, l)),
  599. (F = U.length),
  600. (E = L.length)),
  601. A = F,
  602. O = L.slice(0, F),
  603. R = O.length;
  604. F > R;
  605. O[R++] = 0
  606. );
  607. (_ = U.slice()), _.unshift(0), (D = U[0]), U[1] >= l / 2 && D++;
  608. do {
  609. if (((d = 0), (f = n(U, O, F, R)), 0 > f)) {
  610. if (
  611. ((S = O[0]),
  612. F != R && (S = S * l + (O[1] || 0)),
  613. (d = p(S / D)),
  614. d > 1)
  615. )
  616. for (
  617. d >= l && (d = l - 1),
  618. m = e(U, d, l),
  619. w = m.length,
  620. R = O.length;
  621. 1 == n(m, O, w, R);
  622. )
  623. d--, r(m, w > F ? _ : U, w, l), (w = m.length), (f = 1);
  624. else 0 == d && (f = d = 1), (m = U.slice()), (w = m.length);
  625. if (
  626. (R > w && m.unshift(0),
  627. r(O, m, R, l),
  628. (R = O.length),
  629. -1 == f)
  630. )
  631. for (; n(U, O, F, R) < 1; )
  632. d++, r(O, R > F ? _ : U, R, l), (R = O.length);
  633. } else 0 === f && (d++, (O = [0]));
  634. (y[h++] = d),
  635. O[0] ? (O[R++] = L[A] || 0) : ((O = [L[A]]), (R = 1));
  636. } while ((A++ < E || null != O[0]) && x--);
  637. (g = null != O[0]), y[0] || y.shift();
  638. }
  639. if (l == N) {
  640. for (h = 1, x = y[0]; x >= 10; x /= 10, h++);
  641. I(v, u + (v.e = h + c * b - 1) + 1, s, g);
  642. } else (v.e = c), (v.r = +g);
  643. return v;
  644. };
  645. })()),
  646. (U = (function() {
  647. var e = /^(-?)0([xbo])(?=\w[\w.]*$)/i,
  648. n = /^([^.]+)\.$/,
  649. t = /^\.([^.]+)$/,
  650. r = /^-?(Infinity|NaN)$/,
  651. i = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
  652. return function(o, u, s, l) {
  653. var f,
  654. c = s ? u : u.replace(i, '');
  655. if (r.test(c)) o.s = isNaN(c) ? null : 0 > c ? -1 : 1;
  656. else {
  657. if (
  658. !s &&
  659. ((c = c.replace(e, function(e, n, t) {
  660. return (
  661. (f = 'x' == (t = t.toLowerCase()) ? 16 : 'b' == t ? 2 : 8),
  662. l && l != f ? e : n
  663. );
  664. })),
  665. l && ((f = l), (c = c.replace(n, '$1').replace(t, '0.$1'))),
  666. u != c)
  667. )
  668. return new a(c, f);
  669. z && x(C, 'not a' + (l ? ' base ' + l : '') + ' number', u),
  670. (o.s = null);
  671. }
  672. (o.c = o.e = null), (C = 0);
  673. };
  674. })()),
  675. (M.absoluteValue = M.abs = function() {
  676. var e = new a(this);
  677. return e.s < 0 && (e.s = 1), e;
  678. }),
  679. (M.ceil = function() {
  680. return I(new a(this), this.e + 1, 2);
  681. }),
  682. (M.comparedTo = M.cmp = function(e, n) {
  683. return (C = 1), i(this, new a(e, n));
  684. }),
  685. (M.decimalPlaces = M.dp = function() {
  686. var e,
  687. n,
  688. r = this.c;
  689. if (!r) return null;
  690. if (((e = ((n = r.length - 1) - t(this.e / b)) * b), (n = r[n])))
  691. for (; n % 10 == 0; n /= 10, e--);
  692. return 0 > e && (e = 0), e;
  693. }),
  694. (M.dividedBy = M.div = function(e, n) {
  695. return (C = 3), L(this, new a(e, n), B, P);
  696. }),
  697. (M.dividedToIntegerBy = M.divToInt = function(e, n) {
  698. return (C = 4), L(this, new a(e, n), 0, 1);
  699. }),
  700. (M.equals = M.eq = function(e, n) {
  701. return (C = 5), 0 === i(this, new a(e, n));
  702. }),
  703. (M.floor = function() {
  704. return I(new a(this), this.e + 1, 3);
  705. }),
  706. (M.greaterThan = M.gt = function(e, n) {
  707. return (C = 6), i(this, new a(e, n)) > 0;
  708. }),
  709. (M.greaterThanOrEqualTo = M.gte = function(e, n) {
  710. return (C = 7), 1 === (n = i(this, new a(e, n))) || 0 === n;
  711. }),
  712. (M.isFinite = function() {
  713. return !!this.c;
  714. }),
  715. (M.isInteger = M.isInt = function() {
  716. return !!this.c && t(this.e / b) > this.c.length - 2;
  717. }),
  718. (M.isNaN = function() {
  719. return !this.s;
  720. }),
  721. (M.isNegative = M.isNeg = function() {
  722. return this.s < 0;
  723. }),
  724. (M.isZero = function() {
  725. return !!this.c && 0 == this.c[0];
  726. }),
  727. (M.lessThan = M.lt = function(e, n) {
  728. return (C = 8), i(this, new a(e, n)) < 0;
  729. }),
  730. (M.lessThanOrEqualTo = M.lte = function(e, n) {
  731. return (C = 9), -1 === (n = i(this, new a(e, n))) || 0 === n;
  732. }),
  733. (M.minus = M.sub = function(e, n) {
  734. var r,
  735. i,
  736. o,
  737. u,
  738. s = this,
  739. l = s.s;
  740. if (((C = 10), (e = new a(e, n)), (n = e.s), !l || !n))
  741. return new a(NaN);
  742. if (l != n) return (e.s = -n), s.plus(e);
  743. var f = s.e / b,
  744. c = e.e / b,
  745. h = s.c,
  746. g = e.c;
  747. if (!f || !c) {
  748. if (!h || !g) return h ? ((e.s = -n), e) : new a(g ? s : NaN);
  749. if (!h[0] || !g[0])
  750. return g[0] ? ((e.s = -n), e) : new a(h[0] ? s : 3 == P ? -0 : 0);
  751. }
  752. if (((f = t(f)), (c = t(c)), (h = h.slice()), (l = f - c))) {
  753. for (
  754. (u = 0 > l) ? ((l = -l), (o = h)) : ((c = f), (o = g)),
  755. o.reverse(),
  756. n = l;
  757. n--;
  758. o.push(0)
  759. );
  760. o.reverse();
  761. } else
  762. for (
  763. i = (u = (l = h.length) < (n = g.length)) ? l : n, l = n = 0;
  764. i > n;
  765. n++
  766. )
  767. if (h[n] != g[n]) {
  768. u = h[n] < g[n];
  769. break;
  770. }
  771. if (
  772. (u && ((o = h), (h = g), (g = o), (e.s = -e.s)),
  773. (n = (i = g.length) - (r = h.length)),
  774. n > 0)
  775. )
  776. for (; n--; h[r++] = 0);
  777. for (n = N - 1; i > l; ) {
  778. if (h[--i] < g[i]) {
  779. for (r = i; r && !h[--r]; h[r] = n);
  780. --h[r], (h[i] += N);
  781. }
  782. h[i] -= g[i];
  783. }
  784. for (; 0 == h[0]; h.shift(), --c);
  785. return h[0]
  786. ? _(e, h, c)
  787. : ((e.s = 3 == P ? -1 : 1), (e.c = [(e.e = 0)]), e);
  788. }),
  789. (M.modulo = M.mod = function(e, n) {
  790. var t,
  791. r,
  792. i = this;
  793. return (
  794. (C = 11),
  795. (e = new a(e, n)),
  796. !i.c || !e.s || (e.c && !e.c[0])
  797. ? new a(NaN)
  798. : !e.c || (i.c && !i.c[0])
  799. ? new a(i)
  800. : (9 == H
  801. ? ((r = e.s),
  802. (e.s = 1),
  803. (t = L(i, e, 0, 3)),
  804. (e.s = r),
  805. (t.s *= r))
  806. : (t = L(i, e, 0, H)),
  807. i.minus(t.times(e)))
  808. );
  809. }),
  810. (M.negated = M.neg = function() {
  811. var e = new a(this);
  812. return (e.s = -e.s || null), e;
  813. }),
  814. (M.plus = M.add = function(e, n) {
  815. var r,
  816. i = this,
  817. o = i.s;
  818. if (((C = 12), (e = new a(e, n)), (n = e.s), !o || !n))
  819. return new a(NaN);
  820. if (o != n) return (e.s = -n), i.minus(e);
  821. var u = i.e / b,
  822. s = e.e / b,
  823. l = i.c,
  824. f = e.c;
  825. if (!u || !s) {
  826. if (!l || !f) return new a(o / 0);
  827. if (!l[0] || !f[0]) return f[0] ? e : new a(l[0] ? i : 0 * o);
  828. }
  829. if (((u = t(u)), (s = t(s)), (l = l.slice()), (o = u - s))) {
  830. for (
  831. o > 0 ? ((s = u), (r = f)) : ((o = -o), (r = l)), r.reverse();
  832. o--;
  833. r.push(0)
  834. );
  835. r.reverse();
  836. }
  837. for (
  838. o = l.length,
  839. n = f.length,
  840. 0 > o - n && ((r = f), (f = l), (l = r), (n = o)),
  841. o = 0;
  842. n;
  843. )
  844. (o = ((l[--n] = l[n] + f[n] + o) / N) | 0),
  845. (l[n] = N === l[n] ? 0 : l[n] % N);
  846. return o && (l.unshift(o), ++s), _(e, l, s);
  847. }),
  848. (M.precision = M.sd = function(e) {
  849. var n,
  850. t,
  851. r = this,
  852. i = r.c;
  853. if (
  854. (null != e &&
  855. e !== !!e &&
  856. 1 !== e &&
  857. 0 !== e &&
  858. (z && x(13, 'argument' + d, e), e != !!e && (e = null)),
  859. !i)
  860. )
  861. return null;
  862. if (((t = i.length - 1), (n = t * b + 1), (t = i[t]))) {
  863. for (; t % 10 == 0; t /= 10, n--);
  864. for (t = i[0]; t >= 10; t /= 10, n++);
  865. }
  866. return e && r.e + 1 > n && (n = r.e + 1), n;
  867. }),
  868. (M.round = function(e, n) {
  869. var t = new a(this);
  870. return (
  871. (null == e || V(e, 0, S, 15)) &&
  872. I(
  873. t,
  874. ~~e + this.e + 1,
  875. null != n && V(n, 0, 8, 15, m) ? 0 | n : P
  876. ),
  877. t
  878. );
  879. }),
  880. (M.shift = function(e) {
  881. var n = this;
  882. return V(e, -y, y, 16, 'argument')
  883. ? n.times('1e' + c(e))
  884. : new a(
  885. n.c && n.c[0] && (-y > e || e > y)
  886. ? n.s * (0 > e ? 0 : 1 / 0)
  887. : n
  888. );
  889. }),
  890. (M.squareRoot = M.sqrt = function() {
  891. var e,
  892. n,
  893. i,
  894. o,
  895. u,
  896. s = this,
  897. l = s.c,
  898. f = s.s,
  899. c = s.e,
  900. h = B + 4,
  901. g = new a('0.5');
  902. if (1 !== f || !l || !l[0])
  903. return new a(!f || (0 > f && (!l || l[0])) ? NaN : l ? s : 1 / 0);
  904. if (
  905. ((f = Math.sqrt(+s)),
  906. 0 == f || f == 1 / 0
  907. ? ((n = r(l)),
  908. (n.length + c) % 2 == 0 && (n += '0'),
  909. (f = Math.sqrt(n)),
  910. (c = t((c + 1) / 2) - (0 > c || c % 2)),
  911. f == 1 / 0
  912. ? (n = '1e' + c)
  913. : ((n = f.toExponential()),
  914. (n = n.slice(0, n.indexOf('e') + 1) + c)),
  915. (i = new a(n)))
  916. : (i = new a(f + '')),
  917. i.c[0])
  918. )
  919. for (c = i.e, f = c + h, 3 > f && (f = 0); ; )
  920. if (
  921. ((u = i),
  922. (i = g.times(u.plus(L(s, u, h, 1)))),
  923. r(u.c).slice(0, f) === (n = r(i.c)).slice(0, f))
  924. ) {
  925. if (
  926. (i.e < c && --f,
  927. (n = n.slice(f - 3, f + 1)),
  928. '9999' != n && (o || '4999' != n))
  929. ) {
  930. (!+n || (!+n.slice(1) && '5' == n.charAt(0))) &&
  931. (I(i, i.e + B + 2, 1), (e = !i.times(i).eq(s)));
  932. break;
  933. }
  934. if (!o && (I(u, u.e + B + 2, 0), u.times(u).eq(s))) {
  935. i = u;
  936. break;
  937. }
  938. (h += 4), (f += 4), (o = 1);
  939. }
  940. return I(i, i.e + B + 1, P, e);
  941. }),
  942. (M.times = M.mul = function(e, n) {
  943. var r,
  944. i,
  945. o,
  946. u,
  947. s,
  948. l,
  949. f,
  950. c,
  951. h,
  952. g,
  953. p,
  954. d,
  955. m,
  956. w,
  957. v,
  958. y = this,
  959. O = y.c,
  960. S = ((C = 17), (e = new a(e, n))).c;
  961. if (!(O && S && O[0] && S[0]))
  962. return (
  963. !y.s || !e.s || (O && !O[0] && !S) || (S && !S[0] && !O)
  964. ? (e.c = e.e = e.s = null)
  965. : ((e.s *= y.s),
  966. O && S ? ((e.c = [0]), (e.e = 0)) : (e.c = e.e = null)),
  967. e
  968. );
  969. for (
  970. i = t(y.e / b) + t(e.e / b),
  971. e.s *= y.s,
  972. f = O.length,
  973. g = S.length,
  974. g > f && ((m = O), (O = S), (S = m), (o = f), (f = g), (g = o)),
  975. o = f + g,
  976. m = [];
  977. o--;
  978. m.push(0)
  979. );
  980. for (w = N, v = R, o = g; --o >= 0; ) {
  981. for (
  982. r = 0, p = S[o] % v, d = (S[o] / v) | 0, s = f, u = o + s;
  983. u > o;
  984. )
  985. (c = O[--s] % v),
  986. (h = (O[s] / v) | 0),
  987. (l = d * c + h * p),
  988. (c = p * c + (l % v) * v + m[u] + r),
  989. (r = ((c / w) | 0) + ((l / v) | 0) + d * h),
  990. (m[u--] = c % w);
  991. m[u] = r;
  992. }
  993. return r ? ++i : m.shift(), _(e, m, i);
  994. }),
  995. (M.toDigits = function(e, n) {
  996. var t = new a(this);
  997. return (
  998. (e = null != e && V(e, 1, S, 18, 'precision') ? 0 | e : null),
  999. (n = null != n && V(n, 0, 8, 18, m) ? 0 | n : P),
  1000. e ? I(t, e, n) : t
  1001. );
  1002. }),
  1003. (M.toExponential = function(e, n) {
  1004. return E(this, null != e && V(e, 0, S, 19) ? ~~e + 1 : null, n, 19);
  1005. }),
  1006. (M.toFixed = function(e, n) {
  1007. return E(
  1008. this,
  1009. null != e && V(e, 0, S, 20) ? ~~e + this.e + 1 : null,
  1010. n,
  1011. 20
  1012. );
  1013. }),
  1014. (M.toFormat = function(e, n) {
  1015. var t = E(
  1016. this,
  1017. null != e && V(e, 0, S, 21) ? ~~e + this.e + 1 : null,
  1018. n,
  1019. 21
  1020. );
  1021. if (this.c) {
  1022. var r,
  1023. i = t.split('.'),
  1024. o = +J.groupSize,
  1025. u = +J.secondaryGroupSize,
  1026. s = J.groupSeparator,
  1027. l = i[0],
  1028. f = i[1],
  1029. c = this.s < 0,
  1030. a = c ? l.slice(1) : l,
  1031. h = a.length;
  1032. if ((u && ((r = o), (o = u), (u = r), (h -= r)), o > 0 && h > 0)) {
  1033. for (r = h % o || o, l = a.substr(0, r); h > r; r += o)
  1034. l += s + a.substr(r, o);
  1035. u > 0 && (l += s + a.slice(r)), c && (l = '-' + l);
  1036. }
  1037. t = f
  1038. ? l +
  1039. J.decimalSeparator +
  1040. ((u = +J.fractionGroupSize)
  1041. ? f.replace(
  1042. new RegExp('\\d{' + u + '}\\B', 'g'),
  1043. '$&' + J.fractionGroupSeparator
  1044. )
  1045. : f)
  1046. : l;
  1047. }
  1048. return t;
  1049. }),
  1050. (M.toFraction = function(e) {
  1051. var n,
  1052. t,
  1053. i,
  1054. o,
  1055. u,
  1056. s,
  1057. l,
  1058. f,
  1059. c,
  1060. h = z,
  1061. g = this,
  1062. p = g.c,
  1063. d = new a(T),
  1064. m = (t = new a(T)),
  1065. w = (l = new a(T));
  1066. if (
  1067. (null != e &&
  1068. ((z = !1),
  1069. (s = new a(e)),
  1070. (z = h),
  1071. (!(h = s.isInt()) || s.lt(T)) &&
  1072. (z &&
  1073. x(
  1074. 22,
  1075. 'max denominator ' +
  1076. (h ? 'out of range' : 'not an integer'),
  1077. e
  1078. ),
  1079. (e = !h && s.c && I(s, s.e + 1, 1).gte(T) ? s : null))),
  1080. !p)
  1081. )
  1082. return g.toString();
  1083. for (
  1084. c = r(p),
  1085. o = d.e = c.length - g.e - 1,
  1086. d.c[0] = O[(u = o % b) < 0 ? b + u : u],
  1087. e = !e || s.cmp(d) > 0 ? (o > 0 ? d : m) : s,
  1088. u = G,
  1089. G = 1 / 0,
  1090. s = new a(c),
  1091. l.c[0] = 0;
  1092. (f = L(s, d, 0, 1)), (i = t.plus(f.times(w))), 1 != i.cmp(e);
  1093. )
  1094. (t = w),
  1095. (w = i),
  1096. (m = l.plus(f.times((i = m)))),
  1097. (l = i),
  1098. (d = s.minus(f.times((i = d)))),
  1099. (s = i);
  1100. return (
  1101. (i = L(e.minus(t), w, 0, 1)),
  1102. (l = l.plus(i.times(m))),
  1103. (t = t.plus(i.times(w))),
  1104. (l.s = m.s = g.s),
  1105. (o *= 2),
  1106. (n =
  1107. L(m, w, o, P)
  1108. .minus(g)
  1109. .abs()
  1110. .cmp(
  1111. L(l, t, o, P)
  1112. .minus(g)
  1113. .abs()
  1114. ) < 1
  1115. ? [m.toString(), w.toString()]
  1116. : [l.toString(), t.toString()]),
  1117. (G = u),
  1118. n
  1119. );
  1120. }),
  1121. (M.toNumber = function() {
  1122. return +this;
  1123. }),
  1124. (M.toPower = M.pow = function(e, n) {
  1125. var t,
  1126. r,
  1127. i,
  1128. o = p(0 > e ? -e : +e),
  1129. u = this;
  1130. if (
  1131. (null != n && ((C = 23), (n = new a(n))),
  1132. (!V(e, -y, y, 23, 'exponent') &&
  1133. (!isFinite(e) ||
  1134. (o > y && (e /= 0)) ||
  1135. (parseFloat(e) != e && !(e = NaN)))) ||
  1136. 0 == e)
  1137. )
  1138. return (t = Math.pow(+u, e)), new a(n ? t % n : t);
  1139. for (
  1140. n
  1141. ? e > 1 && u.gt(T) && u.isInt() && n.gt(T) && n.isInt()
  1142. ? (u = u.mod(n))
  1143. : ((i = n), (n = null))
  1144. : W && (t = g(W / b + 2)),
  1145. r = new a(T);
  1146. ;
  1147. ) {
  1148. if (o % 2) {
  1149. if (((r = r.times(u)), !r.c)) break;
  1150. t ? r.c.length > t && (r.c.length = t) : n && (r = r.mod(n));
  1151. }
  1152. if (((o = p(o / 2)), !o)) break;
  1153. (u = u.times(u)),
  1154. t
  1155. ? u.c && u.c.length > t && (u.c.length = t)
  1156. : n && (u = u.mod(n));
  1157. }
  1158. return n
  1159. ? r
  1160. : (0 > e && (r = T.div(r)), i ? r.mod(i) : t ? I(r, W, P) : r);
  1161. }),
  1162. (M.toPrecision = function(e, n) {
  1163. return E(
  1164. this,
  1165. null != e && V(e, 1, S, 24, 'precision') ? 0 | e : null,
  1166. n,
  1167. 24
  1168. );
  1169. }),
  1170. (M.toString = function(e) {
  1171. var n,
  1172. t = this,
  1173. i = t.s,
  1174. o = t.e;
  1175. return (
  1176. null === o
  1177. ? i
  1178. ? ((n = 'Infinity'), 0 > i && (n = '-' + n))
  1179. : (n = 'NaN')
  1180. : ((n = r(t.c)),
  1181. (n =
  1182. null != e && V(e, 2, 64, 25, 'base')
  1183. ? A(f(n, o), 0 | e, 10, i)
  1184. : q >= o || o >= k
  1185. ? l(n, o)
  1186. : f(n, o)),
  1187. 0 > i && t.c[0] && (n = '-' + n)),
  1188. n
  1189. );
  1190. }),
  1191. (M.truncated = M.trunc = function() {
  1192. return I(new a(this), this.e + 1, 1);
  1193. }),
  1194. (M.valueOf = M.toJSON = function() {
  1195. var e,
  1196. n = this,
  1197. t = n.e;
  1198. return null === t
  1199. ? n.toString()
  1200. : ((e = r(n.c)),
  1201. (e = q >= t || t >= k ? l(e, t) : f(e, t)),
  1202. n.s < 0 ? '-' + e : e);
  1203. }),
  1204. (M.isBigNumber = !0),
  1205. null != e && a.config(e),
  1206. a
  1207. );
  1208. }
  1209. function t(e) {
  1210. var n = 0 | e;
  1211. return e > 0 || e === n ? n : n - 1;
  1212. }
  1213. function r(e) {
  1214. for (var n, t, r = 1, i = e.length, o = e[0] + ''; i > r; ) {
  1215. for (n = e[r++] + '', t = b - n.length; t--; n = '0' + n);
  1216. o += n;
  1217. }
  1218. for (i = o.length; 48 === o.charCodeAt(--i); );
  1219. return o.slice(0, i + 1 || 1);
  1220. }
  1221. function i(e, n) {
  1222. var t,
  1223. r,
  1224. i = e.c,
  1225. o = n.c,
  1226. u = e.s,
  1227. s = n.s,
  1228. l = e.e,
  1229. f = n.e;
  1230. if (!u || !s) return null;
  1231. if (((t = i && !i[0]), (r = o && !o[0]), t || r))
  1232. return t ? (r ? 0 : -s) : u;
  1233. if (u != s) return u;
  1234. if (((t = 0 > u), (r = l == f), !i || !o)) return r ? 0 : !i ^ t ? 1 : -1;
  1235. if (!r) return (l > f) ^ t ? 1 : -1;
  1236. for (s = (l = i.length) < (f = o.length) ? l : f, u = 0; s > u; u++)
  1237. if (i[u] != o[u]) return (i[u] > o[u]) ^ t ? 1 : -1;
  1238. return l == f ? 0 : (l > f) ^ t ? 1 : -1;
  1239. }
  1240. function o(e, n, t) {
  1241. return (e = c(e)) >= n && t >= e;
  1242. }
  1243. function u(e) {
  1244. return '[object Array]' == Object.prototype.toString.call(e);
  1245. }
  1246. function s(e, n, t) {
  1247. for (var r, i, o = [0], u = 0, s = e.length; s > u; ) {
  1248. for (i = o.length; i--; o[i] *= n);
  1249. for (o[(r = 0)] += v.indexOf(e.charAt(u++)); r < o.length; r++)
  1250. o[r] > t - 1 &&
  1251. (null == o[r + 1] && (o[r + 1] = 0),
  1252. (o[r + 1] += (o[r] / t) | 0),
  1253. (o[r] %= t));
  1254. }
  1255. return o.reverse();
  1256. }
  1257. function l(e, n) {
  1258. return (
  1259. (e.length > 1 ? e.charAt(0) + '.' + e.slice(1) : e) +
  1260. (0 > n ? 'e' : 'e+') +
  1261. n
  1262. );
  1263. }
  1264. function f(e, n) {
  1265. var t, r;
  1266. if (0 > n) {
  1267. for (r = '0.'; ++n; r += '0');
  1268. e = r + e;
  1269. } else if (((t = e.length), ++n > t)) {
  1270. for (r = '0', n -= t; --n; r += '0');
  1271. e += r;
  1272. } else t > n && (e = e.slice(0, n) + '.' + e.slice(n));
  1273. return e;
  1274. }
  1275. function c(e) {
  1276. return (e = parseFloat(e)), 0 > e ? g(e) : p(e);
  1277. }
  1278. var a,
  1279. h = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
  1280. g = Math.ceil,
  1281. p = Math.floor,
  1282. d = ' not a boolean or binary digit',
  1283. m = 'rounding mode',
  1284. w = 'number type has more than 15 significant digits',
  1285. v = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_',
  1286. N = 1e14,
  1287. b = 14,
  1288. y = 9007199254740991,
  1289. O = [
  1290. 1,
  1291. 10,
  1292. 100,
  1293. 1e3,
  1294. 1e4,
  1295. 1e5,
  1296. 1e6,
  1297. 1e7,
  1298. 1e8,
  1299. 1e9,
  1300. 1e10,
  1301. 1e11,
  1302. 1e12,
  1303. 1e13
  1304. ],
  1305. R = 1e7,
  1306. S = 1e9;
  1307. (a = n()),
  1308. (a['default'] = a.BigNumber = a),
  1309. 'function' == typeof define && define.amd
  1310. ? define(function() {
  1311. return a;
  1312. })
  1313. : 'undefined' != typeof module && module.exports
  1314. ? (module.exports = a)
  1315. : (e ||
  1316. (e =
  1317. 'undefined' != typeof self ? self : Function('return this')()),
  1318. (e.BigNumber = a));
  1319. })(this);
  1320. //# sourceMappingURL=bignumber.js.map
  1321. window.BigNumber = BigNumber;
  1322. })();