Socket
Socket
Sign inDemoInstall

big.js

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

big.js - npm Package Compare versions

Comparing version 3.0.2 to 3.1.1

30

big.js

@@ -1,2 +0,2 @@

/* big.js v3.0.2 https://github.com/MikeMcl/big.js/LICENCE */
/* big.js v3.1.1 https://github.com/MikeMcl/big.js/LICENCE */
;(function (global) {

@@ -6,3 +6,3 @@ 'use strict';

/*
big.js v3.0.2
big.js v3.1.1
A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.

@@ -46,3 +46,3 @@ https://github.com/MikeMcl/big.js/

*/
TO_EXP_NEG = -7, // 0 to -1000000
E_NEG = -7, // 0 to -1000000

@@ -56,3 +56,3 @@ /*

*/
TO_EXP_POS = 21, // 0 to 1000000
E_POS = 21, // 0 to 1000000

@@ -106,2 +106,4 @@ /******************************************************************************/

Big.RM = RM;
Big.E_NEG = E_NEG;
Big.E_POS = E_POS;

@@ -159,3 +161,3 @@ return Big;

*/
return toE === 1 || toE && (dp <= i || i <= TO_EXP_NEG) ?
return toE === 1 || toE && (dp <= i || i <= Big.E_NEG) ?

@@ -994,7 +996,8 @@ // Exponential notation.

* Return exponential notation if this Big has a positive exponent equal to
* or greater than TO_EXP_POS, or a negative exponent equal to or less than
* TO_EXP_NEG.
* or greater than Big.E_POS, or a negative exponent equal to or less than
* Big.E_NEG.
*/
P.toString = P.valueOf = P.toJSON = function () {
var x = this,
Big = x.constructor,
e = x.e,

@@ -1005,3 +1008,3 @@ str = x.c.join(''),

// Exponential notation?
if (e <= TO_EXP_NEG || e >= TO_EXP_POS) {
if (e <= Big.E_NEG || e >= Big.E_POS) {
str = str.charAt(0) + (strL > 1 ? '.' + str.slice(1) : '') +

@@ -1077,7 +1080,8 @@ (e < 0 ? 'e' : 'e+') + e;

x = this,
neg = TO_EXP_NEG,
pos = TO_EXP_POS;
Big = x.constructor,
neg = Big.E_NEG,
pos = Big.E_POS;
// Prevent the possibility of exponential notation.
TO_EXP_NEG = -(TO_EXP_POS = 1 / 0);
Big.E_NEG = -(Big.E_POS = 1 / 0);

@@ -1096,4 +1100,4 @@ if (dp == null) {

}
TO_EXP_NEG = neg;
TO_EXP_POS = pos;
Big.E_NEG = neg;
Big.E_POS = pos;

@@ -1100,0 +1104,0 @@ if (!str) {

@@ -1,1 +0,1 @@

/* big.js v3.0.2 https://github.com/MikeMcl/big.js/LICENCE */(function(n){"use strict";function c(){function n(t){var i=this;if(!(i instanceof n))return t===void 0?c():new n(t);t instanceof n?(i.s=t.s,i.e=t.e,i.c=t.c.slice()):y(i,t);i.constructor=n}return n.prototype=t,n.DP=l,n.RM=a,n}function s(n,t,i){var e=n.constructor,r=t-(n=new e(n)).e,f=n.c;for(f.length>++t&&o(n,r,e.RM),f[0]?i?r=t:(f=n.c,r=n.e+r+1):++r;f.length<r;f.push(0));return r=n.e,i===1||i&&(t<=r||r<=u)?(n.s<0&&f[0]?"-":"")+(f.length>1?f[0]+"."+f.join("").slice(1):f[0])+(r<0?"e":"e+")+r:n.toString()}function y(n,t){var u,r,f;for(t===0&&1/t<0?t="-0":v.test(t+="")||i(NaN),n.s=t.charAt(0)=="-"?(t=t.slice(1),-1):1,(u=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(u<0&&(u=r),u+=+t.slice(r+1),t=t.substring(0,r)):u<0&&(u=t.length),r=0;t.charAt(r)=="0";r++);if(r==(f=t.length))n.c=[n.e=0];else{for(;t.charAt(--f)=="0";);for(n.e=u-r-1,n.c=[],u=0;r<=f;n.c[u++]=+t.charAt(r++));}return n}function o(n,t,r,u){var o,e=n.c,f=n.e+t+1;if(r===1?u=e[f]>=5:r===2?u=e[f]>5||e[f]==5&&(u||f<0||e[f+1]!==o||e[f-1]&1):r===3?u=u||e[f]!==o||f<0:(u=!1,r!==0&&i("!Big.RM!")),f<1||!e[0])u?(n.e=-t,n.c=[1]):n.c=[n.e=0];else{if(e.length=f--,u)for(;++e[f]>9;)e[f]=0,f--||(++n.e,e.unshift(1));for(f=e.length;!e[--f];e.pop());}return n}function i(n){var t=new Error(n);t.name="BigError";throw t;}var l=20,a=1,r=1e6,h=1e6,u=-7,f=21,t={},v=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,e;t.abs=function(){var n=new this.constructor(this);return n.s=1,n};t.cmp=function(n){var e,o=this,u=o.c,f=(n=new o.constructor(n)).c,t=o.s,s=n.s,i=o.e,r=n.e;if(!u[0]||!f[0])return u[0]?t:f[0]?-s:0;if(t!=s)return t;if(e=t<0,i!=r)return i>r^e?1:-1;for(t=-1,s=(i=u.length)<(r=f.length)?i:r;++t<s;)if(u[t]!=f[t])return u[t]>f[t]^e?1:-1;return i==r?0:i>r^e?1:-1};t.div=function(n){var p=this,w=p.constructor,h=p.c,e=(n=new w(n)).c,v=p.s==n.s?1:-1,c=w.DP;if((c!==~~c||c<0||c>r)&&i("!Big.DP!"),!h[0]||!e[0])return h[0]==e[0]&&i(NaN),e[0]||i(v/0),new w(v*0);var s,b,y,l,f,tt,it=e.slice(),k=s=e.length,rt=h.length,t=h.slice(0,s),u=t.length,a=n,d=a.c=[],g=0,nt=c+(a.e=p.e-n.e)+1;for(a.s=v,v=nt<0?0:nt,it.unshift(0);u++<s;t.push(0));do{for(y=0;y<10;y++){if(s!=(u=t.length))l=s>u?1:-1;else for(f=-1,l=0;++f<s;)if(e[f]!=t[f]){l=e[f]>t[f]?1:-1;break}if(l<0){for(b=u==s?e:it;u;){if(t[--u]<b[u]){for(f=u;f&&!t[--f];t[f]=9);--t[f];t[u]+=10}t[u]-=b[u]}for(;!t[0];t.shift());}else break}d[g++]=l?y:++y;t[0]&&l?t[u]=h[k]||0:t=[h[k]]}while((k++<rt||t[0]!==tt)&&v--);return d[0]||g==1||(d.shift(),a.e--),g>nt&&o(a,c,w.RM,t[0]!==tt),a};t.eq=function(n){return!this.cmp(n)};t.gt=function(n){return this.cmp(n)>0};t.gte=function(n){return this.cmp(n)>-1};t.lt=function(n){return this.cmp(n)<0};t.lte=function(n){return this.cmp(n)<1};t.sub=t.minus=function(n){var f,u,o,c,s=this,l=s.constructor,e=s.s,i=(n=new l(n)).s;if(e!=i)return n.s=-i,s.plus(n);var t=s.c.slice(),a=s.e,r=n.c,h=n.e;if(!t[0]||!r[0])return r[0]?(n.s=-i,n):new l(t[0]?s:0);if(e=a-h){for((c=e<0)?(e=-e,o=t):(h=a,o=r),o.reverse(),i=e;i--;o.push(0));o.reverse()}else for(u=((c=t.length<r.length)?t:r).length,e=i=0;i<u;i++)if(t[i]!=r[i]){c=t[i]<r[i];break}if(c&&(o=t,t=r,r=o,n.s=-n.s),(i=(u=r.length)-(f=t.length))>0)for(;i--;t[f++]=0);for(i=f;u>e;){if(t[--u]<r[u]){for(f=u;f&&!t[--f];t[f]=9);--t[f];t[u]+=10}t[u]-=r[u]}for(;t[--i]===0;t.pop());for(;t[0]===0;)t.shift(),--h;return t[0]||(n.s=1,t=[h=0]),n.c=t,n.e=h,n};t.mod=function(n){var e,t=this,r=t.constructor,u=t.s,f=(n=new r(n)).s;return(n.c[0]||i(NaN),t.s=n.s=1,e=n.cmp(t)==1,t.s=u,n.s=f,e)?new r(t):(u=r.DP,f=r.RM,r.DP=r.RM=0,t=t.div(n),r.DP=u,r.RM=f,this.minus(t.times(n)))};t.add=t.plus=function(n){var u,e=this,s=e.constructor,i=e.s,f=(n=new s(n)).s;if(i!=f)return n.s=-f,e.minus(n);var h=e.e,t=e.c,o=n.e,r=n.c;if(!t[0]||!r[0])return r[0]?n:new s(t[0]?e:i*0);if(t=t.slice(),i=h-o){for(i>0?(o=h,u=r):(i=-i,u=t),u.reverse();i--;u.push(0));u.reverse()}for(t.length-r.length<0&&(u=r,r=t,t=u),i=r.length,f=0;i;)f=(t[--i]=t[i]+r[i]+f)/10|0,t[i]%=10;for(f&&(t.unshift(f),++o),i=t.length;t[--i]===0;t.pop());return n.c=t,n.e=o,n};t.pow=function(n){var t=this,u=new t.constructor(1),r=u,f=n<0;for((n!==~~n||n<-h||n>h)&&i("!pow!"),n=f?-n:n;;){if(n&1&&(r=r.times(t)),n>>=1,!n)break;t=t.times(t)}return f?u.div(r):r};t.round=function(n,t){var u=this,f=u.constructor;return n==null?n=0:(n!==~~n||n<0||n>r)&&i("!round!"),o(u=new f(u),n,t==null?f.RM:t),u};t.sqrt=function(){var f,n,e,r=this,u=r.constructor,h=r.c,t=r.s,s=r.e,c=new u("0.5");if(!h[0])return new u(r);t<0&&i(NaN);t=Math.sqrt(r.toString());t===0||t===1/0?(f=h.join(""),f.length+s&1||(f+="0"),n=new u(Math.sqrt(f).toString()),n.e=((s+1)/2|0)-(s<0||s&1)):n=new u(t.toString());t=n.e+(u.DP+=4);do e=n,n=c.times(e.plus(r.div(e)));while(e.c.slice(0,t).join("")!==n.c.slice(0,t).join(""));return o(n,u.DP-=4,u.RM),n};t.mul=t.times=function(n){var t,s=this,h=s.constructor,f=s.c,e=(n=new h(n)).c,o=f.length,i=e.length,u=s.e,r=n.e;if(n.s=s.s==n.s?1:-1,!f[0]||!e[0])return new h(n.s*0);for(n.e=u+r,o<i&&(t=f,f=e,e=t,r=o,o=i,i=r),t=new Array(r=o+i);r--;t[r]=0);for(u=i;u--;){for(i=0,r=o+u;r>u;)i=t[r]+e[u]*f[r-u-1]+i,t[r--]=i%10,i=i/10|0;t[r]=(t[r]+i)%10}for(i&&++n.e,t[0]||t.shift(),u=t.length;!t[--u];t.pop());return n.c=t,n};t.toString=t.valueOf=t.toJSON=function(){var r=this,t=r.e,n=r.c.join(""),i=n.length;if(t<=u||t>=f)n=n.charAt(0)+(i>1?"."+n.slice(1):"")+(t<0?"e":"e+")+t;else if(t<0){for(;++t;n="0"+n);n="0."+n}else if(t>0)if(++t>i)for(t-=i;t--;n+="0");else t<i&&(n=n.slice(0,t)+"."+n.slice(t));else i>1&&(n=n.charAt(0)+"."+n.slice(1));return r.s<0&&r.c[0]?"-"+n:n};t.toExponential=function(n){return n==null?n=this.c.length-1:(n!==~~n||n<0||n>r)&&i("!toExp!"),s(this,n,1)};t.toFixed=function(n){var t,e=this,o=u,h=f;return u=-(f=1/0),n==null?t=e.toString():n===~~n&&n>=0&&n<=r&&(t=s(e,e.e+n),e.s<0&&e.c[0]&&t.indexOf("-")<0&&(t="-"+t)),u=o,f=h,t||i("!toFix!"),t};t.toPrecision=function(n){return n==null?this.toString():((n!==~~n||n<1||n>r)&&i("!toPre!"),s(this,n-1,2))};e=c();typeof define=="function"&&define.amd?define(function(){return e}):typeof module!="undefined"&&module.exports?module.exports=e:n.Big=e})(this)
/* big.js v3.1.1 https://github.com/MikeMcl/big.js/LICENCE */(function(global){"use strict";var DP=20,RM=1,MAX_DP=1e6,MAX_POWER=1e6,E_NEG=-7,E_POS=21,P={},isValid=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Big;function bigFactory(){function Big(n){var x=this;if(!(x instanceof Big)){return n===void 0?bigFactory():new Big(n)}if(n instanceof Big){x.s=n.s;x.e=n.e;x.c=n.c.slice()}else{parse(x,n)}x.constructor=Big}Big.prototype=P;Big.DP=DP;Big.RM=RM;Big.E_NEG=E_NEG;Big.E_POS=E_POS;return Big}function format(x,dp,toE){var Big=x.constructor,i=dp-(x=new Big(x)).e,c=x.c;if(c.length>++dp){rnd(x,i,Big.RM)}if(!c[0]){++i}else if(toE){i=dp}else{c=x.c;i=x.e+i+1}for(;c.length<i;c.push(0)){}i=x.e;return toE===1||toE&&(dp<=i||i<=Big.E_NEG)?(x.s<0&&c[0]?"-":"")+(c.length>1?c[0]+"."+c.join("").slice(1):c[0])+(i<0?"e":"e+")+i:x.toString()}function parse(x,n){var e,i,nL;if(n===0&&1/n<0){n="-0"}else if(!isValid.test(n+="")){throwErr(NaN)}x.s=n.charAt(0)=="-"?(n=n.slice(1),-1):1;if((e=n.indexOf("."))>-1){n=n.replace(".","")}if((i=n.search(/e/i))>0){if(e<0){e=i}e+=+n.slice(i+1);n=n.substring(0,i)}else if(e<0){e=n.length}for(i=0;n.charAt(i)=="0";i++){}if(i==(nL=n.length)){x.c=[x.e=0]}else{for(;n.charAt(--nL)=="0";){}x.e=e-i-1;x.c=[];for(e=0;i<=nL;x.c[e++]=+n.charAt(i++)){}}return x}function rnd(x,dp,rm,more){var u,xc=x.c,i=x.e+dp+1;if(rm===1){more=xc[i]>=5}else if(rm===2){more=xc[i]>5||xc[i]==5&&(more||i<0||xc[i+1]!==u||xc[i-1]&1)}else if(rm===3){more=more||xc[i]!==u||i<0}else{more=false;if(rm!==0){throwErr("!Big.RM!")}}if(i<1||!xc[0]){if(more){x.e=-dp;x.c=[1]}else{x.c=[x.e=0]}}else{xc.length=i--;if(more){for(;++xc[i]>9;){xc[i]=0;if(!i--){++x.e;xc.unshift(1)}}}for(i=xc.length;!xc[--i];xc.pop()){}}return x}function throwErr(message){var err=new Error(message);err.name="BigError";throw err}P.abs=function(){var x=new this.constructor(this);x.s=1;return x};P.cmp=function(y){var xNeg,x=this,xc=x.c,yc=(y=new x.constructor(y)).c,i=x.s,j=y.s,k=x.e,l=y.e;if(!xc[0]||!yc[0]){return!xc[0]?!yc[0]?0:-j:i}if(i!=j){return i}xNeg=i<0;if(k!=l){return k>l^xNeg?1:-1}i=-1;j=(k=xc.length)<(l=yc.length)?k:l;for(;++i<j;){if(xc[i]!=yc[i]){return xc[i]>yc[i]^xNeg?1:-1}}return k==l?0:k>l^xNeg?1:-1};P.div=function(y){var x=this,Big=x.constructor,dvd=x.c,dvs=(y=new Big(y)).c,s=x.s==y.s?1:-1,dp=Big.DP;if(dp!==~~dp||dp<0||dp>MAX_DP){throwErr("!Big.DP!")}if(!dvd[0]||!dvs[0]){if(dvd[0]==dvs[0]){throwErr(NaN)}if(!dvs[0]){throwErr(s/0)}return new Big(s*0)}var dvsL,dvsT,next,cmp,remI,u,dvsZ=dvs.slice(),dvdI=dvsL=dvs.length,dvdL=dvd.length,rem=dvd.slice(0,dvsL),remL=rem.length,q=y,qc=q.c=[],qi=0,digits=dp+(q.e=x.e-y.e)+1;q.s=s;s=digits<0?0:digits;dvsZ.unshift(0);for(;remL++<dvsL;rem.push(0)){}do{for(next=0;next<10;next++){if(dvsL!=(remL=rem.length)){cmp=dvsL>remL?1:-1}else{for(remI=-1,cmp=0;++remI<dvsL;){if(dvs[remI]!=rem[remI]){cmp=dvs[remI]>rem[remI]?1:-1;break}}}if(cmp<0){for(dvsT=remL==dvsL?dvs:dvsZ;remL;){if(rem[--remL]<dvsT[remL]){remI=remL;for(;remI&&!rem[--remI];rem[remI]=9){}--rem[remI];rem[remL]+=10}rem[remL]-=dvsT[remL]}for(;!rem[0];rem.shift()){}}else{break}}qc[qi++]=cmp?next:++next;if(rem[0]&&cmp){rem[remL]=dvd[dvdI]||0}else{rem=[dvd[dvdI]]}}while((dvdI++<dvdL||rem[0]!==u)&&s--);if(!qc[0]&&qi!=1){qc.shift();q.e--}if(qi>digits){rnd(q,dp,Big.RM,rem[0]!==u)}return q};P.eq=function(y){return!this.cmp(y)};P.gt=function(y){return this.cmp(y)>0};P.gte=function(y){return this.cmp(y)>-1};P.lt=function(y){return this.cmp(y)<0};P.lte=function(y){return this.cmp(y)<1};P.sub=P.minus=function(y){var i,j,t,xLTy,x=this,Big=x.constructor,a=x.s,b=(y=new Big(y)).s;if(a!=b){y.s=-b;return x.plus(y)}var xc=x.c.slice(),xe=x.e,yc=y.c,ye=y.e;if(!xc[0]||!yc[0]){return yc[0]?(y.s=-b,y):new Big(xc[0]?x:0)}if(a=xe-ye){if(xLTy=a<0){a=-a;t=xc}else{ye=xe;t=yc}t.reverse();for(b=a;b--;t.push(0)){}t.reverse()}else{j=((xLTy=xc.length<yc.length)?xc:yc).length;for(a=b=0;b<j;b++){if(xc[b]!=yc[b]){xLTy=xc[b]<yc[b];break}}}if(xLTy){t=xc;xc=yc;yc=t;y.s=-y.s}if((b=(j=yc.length)-(i=xc.length))>0){for(;b--;xc[i++]=0){}}for(b=i;j>a;){if(xc[--j]<yc[j]){for(i=j;i&&!xc[--i];xc[i]=9){}--xc[i];xc[j]+=10}xc[j]-=yc[j]}for(;xc[--b]===0;xc.pop()){}for(;xc[0]===0;){xc.shift();--ye}if(!xc[0]){y.s=1;xc=[ye=0]}y.c=xc;y.e=ye;return y};P.mod=function(y){var yGTx,x=this,Big=x.constructor,a=x.s,b=(y=new Big(y)).s;if(!y.c[0]){throwErr(NaN)}x.s=y.s=1;yGTx=y.cmp(x)==1;x.s=a;y.s=b;if(yGTx){return new Big(x)}a=Big.DP;b=Big.RM;Big.DP=Big.RM=0;x=x.div(y);Big.DP=a;Big.RM=b;return this.minus(x.times(y))};P.add=P.plus=function(y){var t,x=this,Big=x.constructor,a=x.s,b=(y=new Big(y)).s;if(a!=b){y.s=-b;return x.minus(y)}var xe=x.e,xc=x.c,ye=y.e,yc=y.c;if(!xc[0]||!yc[0]){return yc[0]?y:new Big(xc[0]?x:a*0)}xc=xc.slice();if(a=xe-ye){if(a>0){ye=xe;t=yc}else{a=-a;t=xc}t.reverse();for(;a--;t.push(0)){}t.reverse()}if(xc.length-yc.length<0){t=yc;yc=xc;xc=t}a=yc.length;for(b=0;a;){b=(xc[--a]=xc[a]+yc[a]+b)/10|0;xc[a]%=10}if(b){xc.unshift(b);++ye}for(a=xc.length;xc[--a]===0;xc.pop()){}y.c=xc;y.e=ye;return y};P.pow=function(n){var x=this,one=new x.constructor(1),y=one,isNeg=n<0;if(n!==~~n||n<-MAX_POWER||n>MAX_POWER){throwErr("!pow!")}n=isNeg?-n:n;for(;;){if(n&1){y=y.times(x)}n>>=1;if(!n){break}x=x.times(x)}return isNeg?one.div(y):y};P.round=function(dp,rm){var x=this,Big=x.constructor;if(dp==null){dp=0}else if(dp!==~~dp||dp<0||dp>MAX_DP){throwErr("!round!")}rnd(x=new Big(x),dp,rm==null?Big.RM:rm);return x};P.sqrt=function(){var estimate,r,approx,x=this,Big=x.constructor,xc=x.c,i=x.s,e=x.e,half=new Big("0.5");if(!xc[0]){return new Big(x)}if(i<0){throwErr(NaN)}i=Math.sqrt(x.toString());if(i===0||i===1/0){estimate=xc.join("");if(!(estimate.length+e&1)){estimate+="0"}r=new Big(Math.sqrt(estimate).toString());r.e=((e+1)/2|0)-(e<0||e&1)}else{r=new Big(i.toString())}i=r.e+(Big.DP+=4);do{approx=r;r=half.times(approx.plus(x.div(approx)))}while(approx.c.slice(0,i).join("")!==r.c.slice(0,i).join(""));rnd(r,Big.DP-=4,Big.RM);return r};P.mul=P.times=function(y){var c,x=this,Big=x.constructor,xc=x.c,yc=(y=new Big(y)).c,a=xc.length,b=yc.length,i=x.e,j=y.e;y.s=x.s==y.s?1:-1;if(!xc[0]||!yc[0]){return new Big(y.s*0)}y.e=i+j;if(a<b){c=xc;xc=yc;yc=c;j=a;a=b;b=j}for(c=new Array(j=a+b);j--;c[j]=0){}for(i=b;i--;){b=0;for(j=a+i;j>i;){b=c[j]+yc[i]*xc[j-i-1]+b;c[j--]=b%10;b=b/10|0}c[j]=(c[j]+b)%10}if(b){++y.e}if(!c[0]){c.shift()}for(i=c.length;!c[--i];c.pop()){}y.c=c;return y};P.toString=P.valueOf=P.toJSON=function(){var x=this,Big=x.constructor,e=x.e,str=x.c.join(""),strL=str.length;if(e<=Big.E_NEG||e>=Big.E_POS){str=str.charAt(0)+(strL>1?"."+str.slice(1):"")+(e<0?"e":"e+")+e}else if(e<0){for(;++e;str="0"+str){}str="0."+str}else if(e>0){if(++e>strL){for(e-=strL;e--;str+="0"){}}else if(e<strL){str=str.slice(0,e)+"."+str.slice(e)}}else if(strL>1){str=str.charAt(0)+"."+str.slice(1)}return x.s<0&&x.c[0]?"-"+str:str};P.toExponential=function(dp){if(dp==null){dp=this.c.length-1}else if(dp!==~~dp||dp<0||dp>MAX_DP){throwErr("!toExp!")}return format(this,dp,1)};P.toFixed=function(dp){var str,x=this,Big=x.constructor,neg=Big.E_NEG,pos=Big.E_POS;Big.E_NEG=-(Big.E_POS=1/0);if(dp==null){str=x.toString()}else if(dp===~~dp&&dp>=0&&dp<=MAX_DP){str=format(x,x.e+dp);if(x.s<0&&x.c[0]&&str.indexOf("-")<0){str="-"+str}}Big.E_NEG=neg;Big.E_POS=pos;if(!str){throwErr("!toFix!")}return str};P.toPrecision=function(sd){if(sd==null){return this.toString()}else if(sd!==~~sd||sd<1||sd>MAX_DP){throwErr("!toPre!")}return format(this,sd-1,2)};Big=bigFactory();if(typeof define==="function"&&define.amd){define(function(){return Big})}else if(typeof module!=="undefined"&&module.exports){module.exports=Big}else{global.Big=Big}})(this);
{
"name": "big.js",
"description": "A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic",
"version": "3.0.2",
"version": "3.1.1",
"keywords": [

@@ -6,0 +6,0 @@ "arbitrary",

@@ -7,3 +7,3 @@

The little sister to [bignumber.js](https://github.com/MikeMcl/bignumber.js/).
See also [decimal.js](https://github.com/MikeMcl/decimal.js/).
See also [decimal.js]((https://github.com/MikeMcl/decimal.js/), and [here](https://github.com/MikeMcl/big.js/wiki) for the difference between them.

@@ -92,4 +92,4 @@ ## Features

z.times(z).round(10) // "0.4444444445"
The value of a Big number is stored in a decimal floating point format in terms of a coefficient, exponent and sign.

@@ -191,7 +191,16 @@

####3.0.2
####3.1.1
* API documentation update, including FAQ additions.
####3.1.0
* Renamed and exposed `TO_EXP_NEG` and `TO_EXP_POS` as `Big.E_NEG` and
`Big.E_POS`.
####3.0.2
* Remove *.npmignore*, use `files` field in *package.json* instead.
####3.0.1
####3.0.1

@@ -221,3 +230,3 @@ * Added `sub`, `add` and `mul` aliases.

* 17/10/13 Conform signed zero to IEEEE 754 (2008).
* 17/10/13 Conform signed zero to IEEEE 754 (2008).

@@ -251,2 +260,1 @@ ####2.4.0

* 7/11/2012 Initial release
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc