tweb/public/npm.big-integer.363d763daad...

2 lines
21 KiB
JavaScript
Raw Normal View History

2022-06-24 19:23:25 +02:00
(this.webpackChunktweb=this.webpackChunktweb||[]).push([[211],{4736:(t,e,r)=>{var o;t=r.nmd(t);var n=function(t){"use strict";var e=1e7,r=9007199254740992,o=v(r),i="0123456789abcdefghijklmnopqrstuvwxyz",u="function"==typeof BigInt;function p(t,e,r,o){return void 0===t?p[0]:void 0===e||10==+e&&!r?Q(t):$(t,e,r,o)}function a(t,e){this.value=t,this.sign=e,this.isSmall=!1}function s(t){this.value=t,this.sign=t<0,this.isSmall=!0}function l(t){this.value=t}function f(t){return-r<t&&t<r}function v(t){return t<1e7?[t]:t<1e14?[t%1e7,Math.floor(t/1e7)]:[t%1e7,Math.floor(t/1e7)%1e7,Math.floor(t/1e14)]}function h(t){y(t);var r=t.length;if(r<4&&P(t,o)<0)switch(r){case 0:return 0;case 1:return t[0];case 2:return t[0]+t[1]*e;default:return t[0]+(t[1]+t[2]*e)*e}return t}function y(t){for(var e=t.length;0===t[--e];);t.length=e+1}function c(t){for(var e=new Array(t),r=-1;++r<t;)e[r]=0;return e}function g(t){return t>0?Math.floor(t):Math.ceil(t)}function m(t,r){var o,n,i=t.length,u=r.length,p=new Array(i),a=0,s=e;for(n=0;n<u;n++)a=(o=t[n]+r[n]+a)>=s?1:0,p[n]=o-a*s;for(;n<i;)a=(o=t[n]+a)===s?1:0,p[n++]=o-a*s;return a>0&&p.push(a),p}function d(t,e){return t.length>=e.length?m(t,e):m(e,t)}function w(t,r){var o,n,i=t.length,u=new Array(i),p=e;for(n=0;n<i;n++)o=t[n]-p+r,r=Math.floor(o/p),u[n]=o-r*p,r+=1;for(;r>0;)u[n++]=r%p,r=Math.floor(r/p);return u}function b(t,r){var o,n,i=t.length,u=r.length,p=new Array(i),a=0,s=e;for(o=0;o<u;o++)(n=t[o]-a-r[o])<0?(n+=s,a=1):a=0,p[o]=n;for(o=u;o<i;o++){if(!((n=t[o]-a)<0)){p[o++]=n;break}n+=s,p[o]=n}for(;o<i;o++)p[o]=t[o];return y(p),p}function S(t,r,o){var n,i,u=t.length,p=new Array(u),l=-r,f=e;for(n=0;n<u;n++)i=t[n]+l,l=Math.floor(i/f),i%=f,p[n]=i<0?i+f:i;return"number"==typeof(p=h(p))?(o&&(p=-p),new s(p)):new a(p,o)}function q(t,r){var o,n,i,u,p=t.length,a=r.length,s=c(p+a),l=e;for(i=0;i<p;++i){u=t[i];for(var f=0;f<a;++f)o=u*r[f]+s[i+f],n=Math.floor(o/l),s[i+f]=o-n*l,s[i+f+1]+=n}return y(s),s}function M(t,r){var o,n,i=t.length,u=new Array(i),p=e,a=0;for(n=0;n<i;n++)o=t[n]*r+a,a=Math.floor(o/p),u[n]=o-a*p;for(;a>0;)u[n++]=a%p,a=Math.floor(a/p);return u}function N(t,e){for(var r=[];e-- >0;)r.push(0);return r.concat(t)}function E(t,e){var r=Math.max(t.length,e.length);if(r<=30)return q(t,e);r=Math.ceil(r/2);var o=t.slice(r),n=t.slice(0,r),i=e.slice(r),u=e.slice(0,r),p=E(n,u),a=E(o,i),s=E(d(n,o),d(u,i)),l=d(d(p,N(b(b(s,p),a),r)),N(a,2*r));return y(l),l}function I(t,r,o){return new a(t<e?M(r,t):q(r,v(t)),o)}function O(t){var r,o,n,i,u=t.length,p=c(u+u),a=e;for(n=0;n<u;n++){o=0-(i=t[n])*i;for(var s=n;s<u;s++)r=i*t[s]*2+p[n+s]+o,o=Math.floor(r/a),p[n+s]=r-o*a;p[n+u]=o}return y(p),p}function B(t,e){var r,o,n,i,u=t.length,p=c(u);for(n=0,r=u-1;r>=0;--r)n=(i=1e7*n+t[r])-(o=g(i/e))*e,p[r]=0|o;return[p,0|n]}function A(t,r){var o,n=Q(r);if(u)return[new l(t.value/n.value),new l(t.value%n.value)];var i,f=t.value,m=n.value;if(0===m)throw new Error("Cannot divide by zero");if(t.isSmall)return n.isSmall?[new s(g(f/m)),new s(f%m)]:[p[0],t];if(n.isSmall){if(1===m)return[t,p[0]];if(-1==m)return[t.negate(),p[0]];var d=Math.abs(m);if(d<e){i=h((o=B(f,d))[0]);var w=o[1];return t.sign&&(w=-w),"number"==typeof i?(t.sign!==n.sign&&(i=-i),[new s(i),new s(w)]):[new a(i,t.sign!==n.sign),new s(w)]}m=v(d)}var S=P(f,m);if(-1===S)return[p[0],t];if(0===S)return[p[t.sign===n.sign?1:-1],p[0]];o=f.length+m.length<=200?function(t,r){var o,n,i,u,p,a,s,l=t.length,f=r.length,v=e,y=c(r.length),g=r[f-1],m=Math.ceil(v/(2*g)),d=M(t,m),w=M(r,m);for(d.length<=l&&d.push(0),w.push(0),g=w[f-1],n=l-f;n>=0;n--){for(o=v-1,d[n+f]!==g&&(o=Math.floor((d[n+f]*v+d[n+f-1])/g)),i=0,u=0,a=w.length,p=0;p<a;p++)i+=o*w[p],s=Math.floor(i/v),u+=d[n+p]-(i-s*v),i=s,u<0?(d[n+p]=u+v,u=-1):(d[n+p]=u,u=0);for(;0!==u;){for(o-=1,i=0,p=0;p<a;p++)(i+=d[n+p]-v+w[p])<0?(d[n+p]=i+v,i=0):(d[n+p]=i,i=1);u+=i}y[n]=o}return d=B(d,m)[0],[h(y),h(d)]}(f,m):function(t,r){for(var o,n,i,u,p,a=t.length,s=r.length,l=[],f=[],v=e;a;)if(f.unshift(t[--a]),y(f),P(f,r)<0)l.push(0);else{i=f[(n=f.length)-1]*v+f[n-2],u=r[s-1]*v+r[s-2],n>s&&(i=(i+1)*v),o=Math.ceil(i/u);do{if(P(p=M(r,o),f)<=0)break;o--}while
2023-02-03 13:17:41 +01:00
//# sourceMappingURL=npm.big-integer.363d763daad0ee4e2741.chunk.js.map