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 4.0.1 to 4.0.2

6

big.js

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

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

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

/*
* big.js v4.0.0
* big.js v4.0.2
* A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
* https://github.com/MikeMcl/big.js/
* Copyright (c) 2014 Michael Mclaughlin <M8ch88l@gmail.com>
* Copyright (c) 2017 Michael Mclaughlin <M8ch88l@gmail.com>
* MIT Expat Licence

@@ -13,0 +13,0 @@ */

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

/* big.js v4.0.1 https://github.com/MikeMcl/big.js/LICENCE */
/* big.js v4.0.2 https://github.com/MikeMcl/big.js/LICENCE */
!function(r){"use strict";function e(){function r(t){var i=this;return i instanceof r?(t instanceof r?(i.s=t.s,i.e=t.e,i.c=t.c.slice()):n(i,t),void(i.constructor=r)):t===p?e():new r(t)}return r.prototype=a,r.DP=s,r.RM=f,r.NE=h,r.PE=l,r}function t(r,e,t){var n=r.constructor,o=e-(r=new n(r)).e,s=r.c;for(s.length>++e&&i(r,o,n.RM),s[0]?t?o=e:(s=r.c,o=r.e+o+1):++o;s.length<o;)s.push(0);return o=r.e,1===t||t&&(o>=e||o<=n.NE)?(r.s<0&&s[0]?"-":"")+(s.length>1?s[0]+"."+s.join("").slice(1):s[0])+(0>o?"e":"e+")+o:r.toString()}function n(r,e){var t,n,i;if(0===e&&0>1/e)e="-0";else if(!g.test(e+=""))throw Error(w+NaN);for(r.s="-"==e.charAt(0)?(e=e.slice(1),-1):1,(t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(0>t&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):0>t&&(t=e.length),i=e.length,n=0;i>n&&"0"==e.charAt(n);)++n;if(n==i)r.c=[r.e=0];else{for(;i>0&&"0"==e.charAt(--i););for(r.e=t-n-1,r.c=[],t=0;i>=n;)r.c[t++]=+e.charAt(n++)}return r}function i(r,e,t,n){var i=r.c,o=r.e+e+1;if(1===t)n=i[o]>=5;else if(2===t)n=i[o]>5||5==i[o]&&(n||0>o||i[o+1]!==p||1&i[o-1]);else if(3===t)n=n||i[o]!==p||0>o;else if(n=!1,0!==t)throw Error(w+"RM: "+t);if(1>o||!i[0])n?(r.e=-e,r.c=[1]):r.c=[r.e=0];else{if(i.length=o--,n)for(;++i[o]>9;)i[o]=0,o--||(++r.e,i.unshift(1));for(o=i.length;!i[--o];)i.pop()}return r}var o,s=20,f=1,c=1e6,u=1e6,h=-7,l=21,a={},g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,w="[BigError] ",p=void 0;a.abs=function(){var r=new this.constructor(this);return r.s=1,r},a.cmp=function(r){var e,t=this,n=t.c,i=(r=new t.constructor(r)).c,o=t.s,s=r.s,f=t.e,c=r.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-s:0;if(o!=s)return o;if(e=0>o,f!=c)return f>c^e?1:-1;for(o=-1,s=(f=n.length)<(c=i.length)?f:c;++o<s;)if(n[o]!=i[o])return n[o]>i[o]^e?1:-1;return f==c?0:f>c^e?1:-1},a.div=function(r){var e=this,t=e.constructor,n=e.c,o=(r=new t(r)).c,s=e.s==r.s?1:-1,f=t.DP;if(f!==~~f||0>f||f>c)throw Error(w+"DP: "+f);if(!n[0]||!o[0]){if(n[0]==o[0])throw Error(w+NaN);if(!o[0])throw Error(w+s/0);return new t(0*s)}var u,h,l,a,g,v=o.slice(),d=u=o.length,E=n.length,m=n.slice(0,u),N=m.length,P=r,M=P.c=[],R=0,D=f+(P.e=e.e-r.e)+1;for(P.s=s,s=0>D?0:D,v.unshift(0);N++<u;)m.push(0);do{for(l=0;10>l;l++){if(u!=(N=m.length))a=u>N?1:-1;else for(g=-1,a=0;++g<u;)if(o[g]!=m[g]){a=o[g]>m[g]?1:-1;break}if(!(0>a))break;for(h=N==u?o:v;N;){if(m[--N]<h[N]){for(g=N;g&&!m[--g];)m[g]=9;--m[g],m[N]+=10}m[N]-=h[N]}for(;!m[0];)m.shift()}M[R++]=a?l:++l,m[0]&&a?m[N]=n[d]||0:m=[n[d]]}while((d++<E||m[0]!==p)&&s--);return M[0]||1==R||(M.shift(),P.e--),R>D&&i(P,f,t.RM,m[0]!==p),P},a.eq=function(r){return!this.cmp(r)},a.gt=function(r){return this.cmp(r)>0},a.gte=function(r){return this.cmp(r)>-1},a.lt=function(r){return this.cmp(r)<0},a.lte=function(r){return this.cmp(r)<1},a.sub=a.minus=function(r){var e,t,n,i,o=this,s=o.constructor,f=o.s,c=(r=new s(r)).s;if(f!=c)return r.s=-c,o.plus(r);var u=o.c.slice(),h=o.e,l=r.c,a=r.e;if(!u[0]||!l[0])return l[0]?(r.s=-c,r):new s(u[0]?o:0);if(f=h-a){for((i=0>f)?(f=-f,n=u):(a=h,n=l),n.reverse(),c=f;c--;)n.push(0);n.reverse()}else for(t=((i=u.length<l.length)?u:l).length,f=c=0;t>c;c++)if(u[c]!=l[c]){i=u[c]<l[c];break}if(i&&(n=u,u=l,l=n,r.s=-r.s),(c=(t=l.length)-(e=u.length))>0)for(;c--;)u[e++]=0;for(c=e;t>f;){if(u[--t]<l[t]){for(e=t;e&&!u[--e];)u[e]=9;--u[e],u[t]+=10}u[t]-=l[t]}for(;0===u[--c];)u.pop();for(;0===u[0];)u.shift(),--a;return u[0]||(r.s=1,u=[a=0]),r.c=u,r.e=a,r},a.mod=function(r){var e,t=this,n=t.constructor,i=t.s,o=(r=new n(r)).s;if(!r.c[0])throw Error(w+NaN);return t.s=r.s=1,e=1==r.cmp(t),t.s=i,r.s=o,e?new n(t):(i=n.DP,o=n.RM,n.DP=n.RM=0,t=t.div(r),n.DP=i,n.RM=o,this.minus(t.times(r)))},a.add=a.plus=function(r){var e,t=this,n=t.constructor,i=t.s,o=(r=new n(r)).s;if(i!=o)return r.s=-o,t.minus(r);var s=t.e,f=t.c,c=r.e,u=r.c;if(!f[0]||!u[0])return u[0]?r:new n(f[0]?t:0*i);if(f=f.slice(),i=s-c){for(i>0?(c=s,e=u):(i=-i,e=f),e.reverse();i--;)e.push(0);e.reverse()}for(f.length-u.length<0&&(e=u,u=f,f=e),i=u.length,o=0;i;f[i]%=10)o=(f[--i]=f[i]+u[i]+o)/10|0;for(o&&(f.unshift(o),++c),i=f.length;0===f[--i];)f.pop();return r.c=f,r.e=c,r},a.pow=function(r){var e=this,t=new e.constructor(1),n=t,i=0>r;if(r!==~~r||-u>r||r>u)throw Error(w+r);for(r=i?-r:r;1&r&&(n=n.times(e)),r>>=1,r;)e=e.times(e);return i?t.div(n):n},a.round=function(r,e){var t=this,n=t.constructor;if(r===p)r=0;else if(r!==~~r||0>r||r>c)throw Error(w+r);return i(new n(t),r,e===p?n.RM:e)},a.sqrt=function(){var r,e,t,n=this,o=n.constructor,s=n.c,f=n.s,c=n.e,u=new o("0.5");if(!s[0])return new o(n);if(0>f)throw Error(w+NaN);f=Math.sqrt(n.toString()),0===f||f===1/0?(r=s.join(""),r.length+c&1||(r+="0"),e=new o(Math.sqrt(r).toString()),e.e=((c+1)/2|0)-(0>c||1&c)):e=new o(f.toString()),f=e.e+(o.DP+=4);do t=e,e=u.times(t.plus(n.div(t)));while(t.c.slice(0,f).join("")!==e.c.slice(0,f).join(""));return i(e,o.DP-=4,o.RM)},a.mul=a.times=function(r){var e,t=this,n=t.constructor,i=t.c,o=(r=new n(r)).c,s=i.length,f=o.length,c=t.e,u=r.e;if(r.s=t.s==r.s?1:-1,!i[0]||!o[0])return new n(0*r.s);for(r.e=c+u,f>s&&(e=i,i=o,o=e,u=s,s=f,f=u),e=new Array(u=s+f);u--;)e[u]=0;for(c=f;c--;){for(f=0,u=s+c;u>c;)f=e[u]+o[c]*i[u-c-1]+f,e[u--]=f%10,f=f/10|0;e[u]=(e[u]+f)%10}for(f?++r.e:e.shift(),c=e.length;!e[--c];)e.pop();return r.c=e,r},a.toString=a.valueOf=a.toJSON=function(){var r=this,e=r.constructor,t=r.e,n=r.c.join(""),i=n.length;if(t<=e.NE||t>=e.PE)n=n.charAt(0)+(i>1?"."+n.slice(1):"")+(0>t?"e":"e+")+t;else if(0>t){for(;++t;)n="0"+n;n="0."+n}else if(t>0)if(++t>i)for(t-=i;t--;)n+="0";else i>t&&(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},a.toExponential=function(r){if(r===p)r=this.c.length-1;else if(r!==~~r||0>r||r>c)throw Error(w+r);return t(this,r,1)},a.toFixed=function(r){var e,n=this,i=n.constructor,o=i.NE,s=i.PE;if(i.NE=-(i.PE=1/0),r===p?e=n.toString():r===~~r&&r>=0&&c>=r&&(e=t(n,n.e+r),n.s<0&&n.c[0]&&e.indexOf("-")<0&&(e="-"+e)),i.NE=o,i.PE=s,!e)throw Error(w+r);return e},a.toPrecision=function(r){if(r===p)return this.toString();if(r!==~~r||1>r||r>c)throw Error(w+r);return t(this,r-1,2)},o=e(),o["default"]=o.Big=o,"function"==typeof define&&define.amd?define(function(){return o}):"undefined"!=typeof module&&module.exports?module.exports=o:r.Big=o}(this);
//# sourceMappingURL=doc/big.js.map
{
"name": "big.js",
"description": "A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic",
"version": "4.0.1",
"version": "4.0.2",
"keywords": [

@@ -37,3 +37,3 @@ "arbitrary",

"test": "node ./test/every-test.js",
"build": "uglifyjs big.js --source-map doc/big.js.map -c -m -o big.min.js --preamble \"/* big.js v4.0.1 https://github.com/MikeMcl/big.js/LICENCE */\""
"build": "uglifyjs big.js --source-map doc/big.js.map -c -m -o big.min.js --preamble \"/* big.js v4.0.2 https://github.com/MikeMcl/big.js/LICENCE */\""
},

@@ -40,0 +40,0 @@ "files": [

@@ -181,5 +181,6 @@

####4.0.1
####4.0.2
* 28/09/17 Add *big.mjs* for use with `node --experimental-modules` flag.
* 28/09/17
* Add *big.mjs* for use with Node.js with `--experimental-modules` flag.

@@ -186,0 +187,0 @@ ####4.0.0

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