diff --git a/docs/ad-notations.community.min.js b/docs/ad-notations.community.min.js index f2b882a..b62b02c 100644 --- a/docs/ad-notations.community.min.js +++ b/docs/ad-notations.community.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("break_infinity.js"),require("tslib")):"function"==typeof define&&define.amd?define(["exports","break_infinity.js","tslib"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ADCommunityNotations={},t.Decimal,t.tslib)}(this,(function(t,e,n){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=o(e),i={isInfinite:function(t){return t.gte(r.default.MAX_VALUE)},exponentCommas:{show:!0,min:1e5,max:1e9},exponentDefaultPlaces:3};function a(t){return Array.from(Array(Math.ceil(t.length/3))).map((function(e,n){return function(t,e){return 0===e?t.slice(-3):t.slice(-3*(e+1),-3*e)}(t,n)})).reverse().join(",")}function u(t,e,n,o){var i=Math.pow(10,e);return Math.round(t.mantissa*i)>=n*i?r.default.fromMantissaExponent_noNormalize(1,t.exponent+o):t}function c(t){var e=t.exponent%3;return r.default.fromMantissaExponent_noNormalize(t.mantissa*Math.pow(10,e),t.exponent-e)}function f(t,e){var n=t.exponent<6?3:6;return u(function(t){var e=t.exponent<6?3:6,n=t.exponent%e;return r.default.fromMantissaExponent_noNormalize(t.mantissa*Math.pow(10,n),t.exponent-n)}(t),e,Math.pow(10,n),n)}var l=["₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"];function p(t){return t.toFixed(0).split("").map((function(t){return"-"===t?"₋":l[parseInt(t,10)]})).join("")}var s=["⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"];function h(t){return t.toFixed(0).split("").map((function(t){return"-"===t?"⁻":s[parseInt(t,10)]})).join("")}var m=["K","M","B","T","Qa","Qt","Sx","Sp","Oc","No"],g=[["","U","D","T","Qa","Qt","Sx","Sp","O","N"],["","Dc","Vg","Tg","Qd","Qi","Se","St","Og","Nn"],["","Ce","Dn","Tc","Qe","Qu","Sc","Si","Oe","Ne"]],y=["","MI-","MC-","NA-","PC-","FM-","AT-","ZP-"];function d(t){var e=t-1;if(-1===e)return"";if(e0;)n.push(g[n.length%3][o%10]),o=Math.floor(o/10);for(;n.length%3!=0;)n.push("");for(var r="",i=n.length/3-1;i>=0;i--)r+=n.slice(3*i,3*i+3).join("")+y[i];return r.replace(/-[A-Z]{2}-/g,"-").replace(/U([A-Z]{2}-)/g,"$1").replace(/-$/,"")}function b(t){return t0||0===i.length;)i.push(e[r%t]),r=Math.floor(r/t);var a=i.reverse().join("");return o>0&&(a=a.padStart(o+1,"0"),a="".concat(a.slice(0,-o),".").concat(a.slice(-o))),a}}for(var D,P=function(){function t(){}return t.prototype.format=function(t,e,n,o){if(void 0===e&&(e=0),void 0===n&&(n=0),void 0===o&&(o=e),"number"==typeof t&&!Number.isFinite(t))return this.infinite;var a=r.default.fromValue_noAlloc(t);if(a.exponent<-300)return a.sign()<0?this.formatVerySmallNegativeDecimal(a.abs(),n):this.formatVerySmallDecimal(a,n);if(a.exponent<3){var u=a.toNumber();return u<0?this.formatNegativeUnder1000(Math.abs(u),n):this.formatUnder1000(u,n)}return i.isInfinite(a.abs())?a.sign()<0?this.negativeInfinite:this.infinite:a.sign()<0?this.formatNegativeDecimal(a.abs(),e,o):this.formatDecimal(a,e,o)},Object.defineProperty(t.prototype,"negativeInfinite",{get:function(){return"-".concat(this.infinite)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"infinite",{get:function(){return"Infinite"},enumerable:!1,configurable:!0}),t.prototype.formatVerySmallNegativeDecimal=function(t,e){return"-".concat(this.formatVerySmallDecimal(t,e))},t.prototype.formatVerySmallDecimal=function(t,e){return this.formatUnder1000(t.toNumber(),e)},t.prototype.formatNegativeUnder1000=function(t,e){return"-".concat(this.formatUnder1000(t,e))},t.prototype.formatUnder1000=function(t,e){return t.toFixed(e)},t.prototype.formatNegativeDecimal=function(t,e,n){return"-".concat(this.formatDecimal(t,e,n))},t.prototype.formatExponent=function(t,e,n,o){return void 0===e&&(e=i.exponentDefaultPlaces),void 0===n&&(n=function(t,e){return t.toString()}),void 0===o&&(o=Math.max(2,e)),b(t)?n(t,Math.max(e,1)):x(t)?(u=n(t,0),(c=u.toString().split("."))[0]=c[0].replace(/\w+$/g,a),c.join(".")):this.formatDecimal(new r.default(t),o,o);var u,c},t}(),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Greek Letters"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"greek",{get:function(){return"άαβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ".split("")},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){for(var n=Math.floor(t.e/3),o=Math.pow(this.greek.length,Math.floor(Math.log(n)/Math.log(this.greek.length))),i="";o>=1;){var a=Math.floor(n/o);i+=this.greek[a],n-=o*a,o/=this.greek.length}var u=r.default.pow(10,r.default.log10(t)%3).toFixed(e);return"".concat(u," ").concat(i)},e}(P),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Omega"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"greek",{get:function(){return"βζλψΣΘΨω"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"Ω"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.formatDecimal(new r.default(t))},e.prototype.formatDecimal=function(t){var e=r.default.floor(t.div(1e3)),n=r.default.floor(e.div(this.greek.length)),o=this.greek[e.toNumber()%this.greek.length]+p(t.toNumber()%1e3);(void 0===this.greek[e.toNumber()%this.greek.length]||e.toNumber()>Number.MAX_SAFE_INTEGER)&&(o="ω");var i=r.default.log(t,8e3);if(n.equals(0))return o;if(n.gt(0)&&n.lte(3)){for(var a=[],u=0;uNumber.MAX_SAFE_INTEGER)&&(o="ω");var i=r.default.log(t,8e3);if(n.equals(0))return o;if(n.gt(0)&&n.lte(2)){for(var a=[],u=0;u1&&o})),i=n.map((function(n,i){return e.maybeParenthesize(i===t.length-1&&o?h(n[0]):e.formatFromList(n),r[i])}));if(o){var a=i.pop();i[t.length-2]+=a}return i.join("^")},e.prototype.formatFromList=function(t){for(var e=[],n=0,o=0,r=0,i=t;r0&&(o>1?e.push("".concat(n).concat(h(o))):e.push(n)),n=a,o=1)}return o>1?e.push("".concat(n).concat(h(o))):e.push(n),e.join("×")},e.prototype.primesFromInt=function(t){for(var e=t,n=[],o=0,r=[2,3];o1&&n.push(e),n},e}(P),I=["","万","億","兆","京","垓","秭","穣","溝","澗","正","載","極","恒河沙","阿僧祇","那由他","不可思議","無量大数"],F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Japanese"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"無限"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){return t.exponent<72?this.jpnNotation(t):"".concat(t.mantissa.toFixed(e),"×10の").concat(this.jpnNotation(new r.default(t.exponent)),"乗")},e.prototype.getSuffix=function(t){return I[t]},e.prototype.jpnNotation=function(t){var e=Math.max(0,Math.floor(t.exponent/4)),n=r.default.times(r.default.pow(10,t.exponent-4*e),t.mantissa).toFixed(4),o=r.default.floor(n),i=r.default.times(r.default.minus(n,o),1e4),a="".concat(o.toString()).concat(this.getSuffix(e));return e>=1&&i.neq(0)&&(a+="".concat(i.toString()).concat(this.getSuffix(e-1))),a},e}(P),U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Scientific"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,n){return v(M,this.formatExponent.bind(this),10,1,!1)(t,e,n)},e}(P),C=new U,k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Mixed Logarithm (Sci)"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,n){if(t.exponent<33)return C.formatDecimal(t,e,n);var o=t.log10();return"e".concat(this.formatExponent(o,e,(function(t,e){return t.toFixed(e)}),n))},e}(P),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Tritetrated"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"Infinity"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.tritetrated(new r.default(t))},e.prototype.formatDecimal=function(t){return this.tritetrated(t)},e.prototype.tritetrated=function(t){for(var e=0,n=16;n-e>1e-7;){var o=(e+n)/2;r.default.pow(o,Math.pow(o,o)).lt(t)?e=o:n=o}return"".concat(e.toFixed(4),"↑↑3")},e}(P),q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Engineering"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,n){return v(M,this.formatExponent.bind(this),10,3,!1)(t,e,n)},e}(P),B=function(t){function e(e,n,o){void 0===n&&(n=""),void 0===o&&(o="");var r=this;if(e.length<2)throw new Error("The supplied letter sequence must contain at least 2 letters");return(r=t.call(this)||this).letters=e,r.mantissaExponentSeparator=n,r.separator=o,r}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Custom"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){var n=c(t);return n.mantissa.toFixed(e)+this.mantissaExponentSeparator+this.transcribe(n.exponent).join(this.separator)},e.prototype.transcribe=function(t){var e=t/3,n=this.letters.length;if(e<=n)return[this.letters[e-1]];for(var o=[];e>n;){var r=e%n,i=(0===r?n:r)-1;o.push(this.letters[i]),e=(e-r)/n,0===r&&e--}return o.push(this.letters[e-1]),o.reverse()},e}(q),V=["🇦🇫","🇦🇩","🇦🇪","🇦🇫","🇦🇬","🇦🇮","🇦🇱","🇦🇲","🇦🇴","🇦🇶","🇦🇷","🇦🇸","🇦🇹","🇦🇺","🇦🇼","🇦🇽","🇦🇿","🇧🇦","🇧🇧","🇧🇩","🇧🇪","🇧🇫","🇧🇬","🇧🇭","🇧🇮","🇧🇯","🇧🇱","🇧🇲","🇧🇳","🇧🇴","🇧🇶","🇧🇷","🇧🇸","🇧🇹","🇧🇻","🇧🇼","🇧🇾","🇧🇿","🇨🇦","🇨🇨","🇨🇩","🇨🇫","🇨🇬","🇨🇭","🇨🇮","🇨🇰","🇨🇱","🇨🇲","🇨🇳","🇨🇴","🇨🇵","🇨🇷","🇨🇺","🇨🇻","🇨🇼","🇨🇽","🇨🇾","🇨🇿","🇩🇪","🇩🇬","🇩🇯","🇩🇰","🇩🇲","🇩🇴","🇩🇿","🇪🇦","🇪🇨","🇪🇪","🇪🇬","🇪🇭","🇪🇷","🇪🇸","🇪🇹","🇪🇺","🇫🇮","🇫🇯","🇫🇰","🇫🇲","🇫🇴","🇫🇷","🇬🇦","🇬🇧","🇬🇩","🇬🇪","🇬🇫","🇬🇬","🇬🇭","🇬🇮","🇬🇱","🇬🇲","🇬🇳","🇬🇵","🇬🇶","🇬🇷","🇬🇸","🇬🇹","🇬🇺","🇬🇼","🇬🇾","🇭🇰","🇭🇲","🇭🇳","🇭🇷","🇭🇹","🇭🇺","🇮🇨","🇮🇩","🇮🇪","🇮🇱","🇮🇲","🇮🇳","🇮🇴","🇮🇶","🇮🇷","🇮🇸","🇮🇹","🇯🇪","🇯🇲","🇯🇴","🇯🇵","🇰🇪","🇰🇬","🇰🇭","🇰🇮","🇰🇲","🇰🇳","🇰🇵","🇰🇷","🇰🇼","🇰🇾","🇰🇿","🇱🇦","🇱🇧","🇱🇨","🇱🇮","🇱🇰","🇱🇷","🇱🇸","🇱🇹","🇱🇺","🇱🇻","🇱🇾","🇲🇦","🇲🇨","🇲🇩","🇲🇪","🇲🇫","🇲🇬","🇲🇭","🇲🇰","🇲🇱","🇲🇲","🇲🇳","🇲🇴","🇲🇵","🇲🇶","🇲🇷","🇲🇸","🇲🇹","🇲🇺","🇲🇻","🇲🇼","🇲🇽","🇲🇾","🇲🇿","🇳🇦","🇳🇨","🇳🇪","🇳🇫","🇳🇬","🇳🇮","🇳🇱","🇳🇴","🇳🇵","🇳🇷","🇳🇺","🇳🇿","🇴🇲","🇵🇦","🇵🇪","🇵🇫","🇵🇬","🇵🇭","🇵🇰","🇵🇱","🇵🇲","🇵🇳","🇵🇷","🇵🇸","🇵🇹","🇵🇼","🇵🇾","🇶🇦","🇷🇪","🇷🇴","🇷🇸","🇷🇺","🇷🇼","🇸🇦","🇸🇧","🇸🇨","🇸🇩","🇸🇪","🇸🇬","🇸🇭","🇸🇮","🇸🇯","🇸🇰","🇸🇱","🇸🇲","🇸🇳","🇸🇴","🇸🇷","🇸🇸","🇸🇹","🇸🇻","🇸🇽","🇸🇾","🇸🇿","🇹🇦","🇹🇨","🇹🇩","🇹🇫","🇹🇬","🇹🇭","🇹🇯","🇹🇰","🇹🇱","🇹🇲","🇹🇳","🇹🇴","🇹🇷","🇹🇹","🇹🇻","🇹🇼","🇹🇿","🇺🇦","🇺🇬","🇺🇲","🇺🇳","🇺🇸","🇺🇾","🇺🇿","🇻🇦","🇻🇨","🇻🇪","🇻🇬","🇻🇮","🇻🇳","🇻🇺","🇼🇫","🇼🇸","🇽🇰","🇾🇪","🇾🇹","🇿🇦","🇿🇲","🇿🇼"],L=function(t){function e(){return t.call(this,V)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Flags"},enumerable:!1,configurable:!0}),e}(B),H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"YesNo"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"negativeInfinite",{get:function(){return"YES"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"YES"},enumerable:!1,configurable:!0}),e.prototype.formatVerySmallNegativeDecimal=function(t){return t.neq(0)?"YES":"NO"},e.prototype.formatVerySmallDecimal=function(t){return t.neq(0)?"YES":"NO"},e.prototype.formatNegativeUnder1000=function(t){return 0!==t?"YES":"NO"},e.prototype.formatUnder1000=function(t){return 0!==t?"YES":"NO"},e.prototype.formatNegativeDecimal=function(t){return t.neq(0)?"YES":"NO"},e.prototype.formatDecimal=function(t){return t.neq(0)?"YES":"NO"},e}(P),R=new U,Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Evil"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){var n=Math.log(t.log(2))/Math.log(2),o=Math.round(n),i=new r.default;return i=o<6||Math.abs(n-o)>.25?t:t.pow(o%2==0?2:.5),R.format(i,e)},e}(P),Z=new U,z=["🎂","🎄","💀","👪","🌈","💯","🎃","💋","😂","🌙"],G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Emojier"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t,e){return this.affect(Z.formatUnder1000(t,e))},e.prototype.formatDecimal=function(t,e,n){return this.affect(Z.formatDecimal(t,e,n))},e.prototype.affect=function(t){for(var e=t.split(""),n=[],o=0;o0?this.formatUnder10000(o)+Q[e/4-1]:"")},e.prototype.formatUnder10000WithPlaces=function(t){return"".concat(this.formatUnder1000(t),"點").concat([1,2,3].map((function(e){return X[Math.floor(t*Math.pow(10,e))%10]})).join(""))},e.prototype.formatUnder10000=function(t){return[3,2,1,0].map((function(e){var n=Math.floor(t/Math.pow(10,e))%10;return 0===n?"":1===n&&1===e?$[e]:X[n]+$[e]})).join("")||X[0]},e}(P),W=[["H"],["He","Li","Be","B","C","N","O","F"],["Ne","Na","Mg","Al","Si","P","S","Cl"],["Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br"],["Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I"],["Xe","Cs","Ba","La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At"],["Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Db","Sg","Bh","Hs","Mt","Ds","Rg","Cn","Nh","Fl","Mc","Lv","Ts"],["Og"]],J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Elemental"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"Infinity"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t,e){return this.elemental(new r.default(t),e)},e.prototype.formatDecimal=function(t,e){return this.elemental(t,e)},e.prototype.getAbbreviationAndValue=function(t){var e=Math.log(t)/Math.log(118),n=Math.floor(e),o=W[Math.floor(n)],r=Math.floor((e-n)*o.length);return[o[r],Math.pow(118,n+r/o.length)]},e.prototype.formatElementalPart=function(t,e){return 1===e?t:"".concat(e," ").concat(t)},e.prototype.elemental=function(t,e){for(var n=this,o=t.log(118),i=[];o>=1&&i.length<4;){var a=this.getAbbreviationAndValue(o),u=a[0],c=a[1],f=Math.floor(o/c);o-=f*c,i.unshift([u,f])}if(i.length>=4)return i.map((function(t){return n.formatElementalPart(t[0],t[1])})).join(" + ");var l=r.default.pow(118,o).toFixed(e);return 0===i.length?l:1===i.length?"".concat(l," × ").concat(this.formatElementalPart(i[0][0],i[0][1])):"".concat(l," × (").concat(i.map((function(t){return n.formatElementalPart(t[0],t[1])})).join(" + "),")")},e}(P),tt=function(t){function e(e,n,o){var r=this;if(e.length<2)throw new Error("The supplied digits must contain at least 2 digits");return(r=t.call(this)||this).formatBase=e.length,r.digits=e,r.exponentBase=n,r.useLogIfExponentIsFormatted=o,r}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Custom Base"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t,e){return N(this.formatBase,this.digits)(t,e)},e.prototype.formatDecimal=function(t,e,n){var o=this;return v(N(this.formatBase,this.digits),(function(t,e){return o.formatExponent(t,e,(function(t,e){return N(o.formatBase,o.digits)(t,0)}))}),this.exponentBase,1,this.useLogIfExponentIsFormatted)(t,e,n)},e}(P),et=function(t){function e(){return t.call(this,"01",2,!1)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Binary"},enumerable:!1,configurable:!0}),e}(tt),nt=function(t){function e(){return t.call(this,"0123456789ABCDEF",16,!1)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Hexadecimal"},enumerable:!1,configurable:!0}),e}(tt),ot=Math.log(69),rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Haha Funny"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t){if(t.eq(0))return"42069";if(t.lt(1))return this.formatDecimal(t.pow(-1)).split("").reverse().join("");for(var e=Math.LN10/ot*t.log10(),n=Math.floor(e*Math.pow(69,2)),o=[];n>0||o.length<3;){var r=n%69;n=Math.floor(n/69),o.push((r+1).toString())}return o.join("")},Object.defineProperty(e.prototype,"infinite",{get:function(){return"69420"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.formatDecimal(new r.default(t))},e}(P),it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Nice"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){return t.log(69).toFixed(Math.max(2,e)).replace("-","^")},Object.defineProperty(e.prototype,"infinite",{get:function(){return"69420"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t,e){return this.formatDecimal(new r.default(t),e)},e}(P),at=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Long scale",e}return n.__extends(e,t),e.prototype.formatDecimal=function(t,e){var n=f(t,e),o=n.mantissa.toFixed(e),r=d(Math.floor(n.exponent/6)+1);return"".concat(o," ").concat(r).replace(/[,.]/g,(function(t){return"."===t?",":"."}))},e}(P),ut=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Abstract Infix",e.groupDigits=3,e.canHandleZeroExponent=!0,e}return n.__extends(e,t),e.prototype.formatDecimal=function(t,e,n){return this.formatInfix(t,e)},e.prototype.format=function(t,e,n,o){if(void 0===e&&(e=0),void 0===o&&(o=e),"number"==typeof t&&!Number.isFinite(t))return this.infinite;var a=r.default.fromValue_noAlloc(t);return i.isInfinite(a.abs())?a.sign()<0?this.negativeInfinite:this.infinite:a.sign()<0?this.formatNegativeDecimal(a.abs(),e,o):this.formatDecimal(a,e,o)},e.prototype.formatInfix=function(t,e){var n=u(t,this.numberOfPlaces(t,e),10,1),o=this.numberOfPlaces(n,e),r=n.mantissa.toFixed(o).replace(".",""),i=[],a=!1;-1===n.exponent&&(this.canHandleZeroExponent?i.push(this.formatExponent(0)):i.push("."));for(var c=0;c=0&&t=0?Math.min(n,n=1e3,i=r?1:n.mantissa+o/2,a=n.exponent+(r?1:0),f=this.formatUnits(i,e),l=this.formatPrefixes(a);return"".concat(f," ").concat(l)},e.prototype.formatUnits=function(t,e){var n=[],o=t,r=Math.pow(10,-e);if(t>=100){var i=Math.floor(t/100);n.push("".concat(st[i]," hundred")),t-=100*i}if(t<20){t>=1&&n.length>0&&n.push("and");i=Math.floor(t);n.push(t<1&&o>1?"":st[i]),t-=i}else{n.length>0&&n.push("and");i=Math.floor(t/10);n.push(ht[i]),t-=10*i,0!==(i=Math.floor(t))&&(n.push(st[i]),t-=i)}if(t>=Math.pow(10,-e)&&e>0){n.push("point");for(i=0;t>=r&&i=10;)t=Math.floor(t/10),n.push(mt[++e%3][t%10]);for(e=Math.floor(e/3);n.length%3!=0;)n.push("");for(var o="";e>=0;){if("un"!==n[3*e]||""!==n[3*e+1]||""!==n[3*e+2]||0===e){var r=n[3*e+1]+n[3*e+2];["tre","se"].includes(n[3*e])&&["v","t","q"].includes(r.substr(0,1))&&(r="s".concat(r)),"se"===n[3*e]&&["c","o"].includes(r.substr(0,1))&&(r="x".concat(r)),["septe","nove"].includes(n[3*e])&&["v","o"].includes(r.substr(0,1))&&(r="m".concat(r)),["septe","nove"].includes(n[3*e])&&["d","c","t","q","s"].includes(r.substr(0,1))&&(r="n".concat(r)),o+=n[3*e]+r}""===n[3*e]&&""===n[3*e+1]&&""===n[3*e+2]||(o+=gt[e]),e--}return o=o.replace(/-$/,""),"".concat(o,"illion").replace("i-illion","illion").replace("iillion","illion").replace("aillion","illion").replace("oillion","illion").replace("eillion","illion").replace("unillion","untillion").replace("duillion","duotillion").replace("trillion","tretillion").replace("quattuorillion","quadrillion").replace("quinillion","quintillion").replace("sillion","sextillion").replace("novillion","nonillion")},e}(q),dt=Math.log10(4),bt=["4-4","4÷4","√4","4-4÷4","4","4+4÷4","4!÷4","(4!+4)÷4","4+4","4+4+4÷4","4!÷4+4","44÷4","4!÷√4","44÷4+√4","4×4-√4","4×4-4÷4"],xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Fours"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"negativeInfinite",{get:function(){return"-∞"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"∞"},enumerable:!1,configurable:!0}),e.prototype.formatVerySmallNegativeDecimal=function(t){return this.formatNegativeDecimal(t)},e.prototype.formatVerySmallDecimal=function(t){return this.formatDecimal(t)},e.prototype.formatNegativeUnder1000=function(t){var e=this.formatUnder1000(t);return"-".concat(this.bracketify(e))},e.prototype.formatUnder1000=function(t){var e=Math.log10(t);return 0===t?bt[0]:e<0?this.formatAsFraction(new r.default(t)):this.formatAsInteger(t)},e.prototype.formatNegativeDecimal=function(t){var e=this.formatDecimal(t);return"-".concat(this.bracketify(e))},e.prototype.formatDecimal=function(t){if(t.sign()<0)return this.formatNegativeDecimal(r.default.minus(0,t));var e=t.log10(),n=Math.abs(e);return n>=24?this.formatAsPow(t):n>=3?this.formatAsRoot(t):this.formatUnder1000(t.toNumber())},e.prototype.formatAsPow=function(t){var e=t.log10()/dt,n=this.formatDecimal(new r.default(e));return"4^".concat(this.bracketify(n))},e.prototype.formatAsRoot=function(t){var e=r.default.sqrt(t),n=this.formatDecimal(e);return"(".concat(n,")^").concat(bt[2])},e.prototype.formatAsInteger=function(t){if(t>=16){var e=Math.floor(t/16),n=Math.floor(Math.max(0,Math.min(15,t-16*e))),o=0===n?"":"".concat(bt[Math.floor(n)],"+"),r=1===e?"":"×".concat(this.multiBracketify(this.formatAsInteger(e)));return"".concat(o,"4×4").concat(r)}return bt[Math.floor(t)]},e.prototype.formatAsFraction=function(t){var e=r.default.div(4,t),n=this.formatDecimal(e);return"4÷".concat(this.bracketify(n))},e.prototype.bracketify=function(t){return"^"!==(t.match(/[\+\-\×÷\^]/)||["^"])[0]?"(".concat(t,")"):t},e.prototype.multiBracketify=function(t){for(var e=0,n=0;n=1&&(n="-".concat(r[0]+1)),this.blobConstructor(e+this.prefixes[Math.floor(r[1])],this.suffixes[Math.floor(r[2])]+n)},e.prototype.blobConstructor=function(t,e){return":".concat(t,"blob").concat(e,":")},e}(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Blobs"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"".concat("")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"negativeInfinite",{get:function(){return"".concat("").concat("")},enumerable:!1,configurable:!0}),e.prototype.formatNegativeUnder1000=function(t){return"".concat("").concat(this.blobify(new r.default(t-1)))},e.prototype.formatNegativeDecimal=function(t){return"".concat("").concat(this.blobify(t.minus(1)))},e.prototype.formatUnder1000=function(t){return this.blobify(new r.default(t))},e.prototype.formatDecimal=function(t){return this.blobify(t)},e.prototype.blobify=function(t){var e=this.reduceNumber(t.abs());return e<23?Mt[Math.floor(e)]:Math.floor(e/23)<24?Mt[Math.floor(e/23)-1]+Mt[Math.floor(e%23)]:this.blobify(r.default.floor(e/23-1))+Mt[Math.floor(e%23)]},e.prototype.reduceNumber=function(t){return t.lte(1e3)?t.toNumber():(Math.log10(t.log10())-Pt)/Math.log10(1.0002)+1e3},e}(P)),_t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Blobs (Short Text)"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prefixNegative",{get:function(){return"un"},enumerable:!1,configurable:!0}),e.prototype.blobify=function(t){var e="",n="",o=this.reduceNumber(t.abs());-1===t.sign()&&(e=this.prefixNegative,o=Math.max(0,o-1));var r=[Math.floor(o/this.suffixes.length),o%this.suffixes.length];return r[0]>=1&&(n="-".concat(r[0]+1)),this.blobConstructor(e,this.suffixes[Math.floor(r[1])]+n)},e}(jt);t.BinaryNotation=et,t.BlobsShortTextNotation=_t,t.BlobsTextNotation=jt,t.ChineseNotation=K,t.CustomBaseNotation=tt,t.ElementalNotation=J,t.EmojierNotation=G,t.EnglishNotation=yt,t.EvilNotation=Y,t.FlagsNotation=L,t.FoursNotation=xt,t.GreekLettersNotation=j,t.HahaFunnyNotation=rt,t.HexadecimalNotation=nt,t.InfixEngineeringNotation=ct,t.InfixEngineeringReverseNotation=ft,t.InfixLongScaleNotation=pt,t.InfixShortScaleNotation=lt,t.JapaneseNotation=F,t.LongScaleNotation=at,t.MixedLogarithmSciNotation=k,t.NiceNotation=it,t.Notation=P,t.OmegaNotation=_,t.OmegaShortNotation=O,t.PrecisePrimeNotation=A,t.Settings=i,t.TritetratedNotation=T,t.YesNoNotation=H,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("break_infinity.js"),require("tslib")):"function"==typeof define&&define.amd?define(["exports","break_infinity.js","tslib"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ADCommunityNotations={},t.Decimal,t.tslib)}(this,(function(t,e,n){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=o(e),i={isInfinite:function(t){return t.gte(r.default.MAX_VALUE)},exponentCommas:{show:!0,min:1e5,max:1e9},exponentDefaultPlaces:3};function a(t){return Array.from(Array(Math.ceil(t.length/3))).map((function(e,n){return function(t,e){return 0===e?t.slice(-3):t.slice(-3*(e+1),-3*e)}(t,n)})).reverse().join(",")}function u(t,e,n,o){var i=Math.pow(10,e);return Math.round(t.mantissa*i)>=n*i?r.default.fromMantissaExponent_noNormalize(1,t.exponent+o):t}function f(t){var e=t.exponent%3;return r.default.fromMantissaExponent_noNormalize(t.mantissa*Math.pow(10,e),t.exponent-e)}function c(t,e){var n=t.exponent<6?3:6;return u(function(t){var e=t.exponent<6?3:6,n=t.exponent%e;return r.default.fromMantissaExponent_noNormalize(t.mantissa*Math.pow(10,n),t.exponent-n)}(t),e,Math.pow(10,n),n)}var l=["₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"];function p(t){return t.toFixed(0).split("").map((function(t){return"-"===t?"₋":l[parseInt(t,10)]})).join("")}var s=["⁰","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹"];function h(t){return t.toFixed(0).split("").map((function(t){return"-"===t?"⁻":s[parseInt(t,10)]})).join("")}var m=["K","M","B","T","Qa","Qt","Sx","Sp","Oc","No"],g=[["","U","D","T","Qa","Qt","Sx","Sp","O","N"],["","Dc","Vg","Tg","Qd","Qi","Se","St","Og","Nn"],["","Ce","Dn","Tc","Qe","Qu","Sc","Si","Oe","Ne"]],y=["","MI-","MC-","NA-","PC-","FM-","AT-","ZP-"];function d(t){var e=t-1;if(-1===e)return"";if(e0;)n.push(g[n.length%3][o%10]),o=Math.floor(o/10);for(;n.length%3!=0;)n.push("");for(var r="",i=n.length/3-1;i>=0;i--)r+=n.slice(3*i,3*i+3).join("")+y[i];return r.replace(/-[A-Z]{2}-/g,"-").replace(/U([A-Z]{2}-)/g,"$1").replace(/-$/,"")}function b(t){return t0||0===i.length;)i.push(e[r%t]),r=Math.floor(r/t);var a=i.reverse().join("");return o>0&&(a=a.padStart(o+1,"0"),a="".concat(a.slice(0,-o),".").concat(a.slice(-o))),a}}for(var D,P=function(){function t(){}return t.prototype.format=function(t,e,n,o){if(void 0===e&&(e=0),void 0===n&&(n=0),void 0===o&&(o=e),"number"==typeof t&&!Number.isFinite(t))return this.infinite;var a=r.default.fromValue_noAlloc(t);if(a.exponent<-300)return a.sign()<0?this.formatVerySmallNegativeDecimal(a.abs(),n):this.formatVerySmallDecimal(a,n);if(a.exponent<3){var u=a.toNumber();return u<0?this.formatNegativeUnder1000(Math.abs(u),n):this.formatUnder1000(u,n)}return i.isInfinite(a.abs())?a.sign()<0?this.negativeInfinite:this.infinite:a.sign()<0?this.formatNegativeDecimal(a.abs(),e,o):this.formatDecimal(a,e,o)},Object.defineProperty(t.prototype,"negativeInfinite",{get:function(){return"-".concat(this.infinite)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"infinite",{get:function(){return"Infinite"},enumerable:!1,configurable:!0}),t.prototype.formatVerySmallNegativeDecimal=function(t,e){return"-".concat(this.formatVerySmallDecimal(t,e))},t.prototype.formatVerySmallDecimal=function(t,e){return this.formatUnder1000(t.toNumber(),e)},t.prototype.formatNegativeUnder1000=function(t,e){return"-".concat(this.formatUnder1000(t,e))},t.prototype.formatUnder1000=function(t,e){return t.toFixed(e)},t.prototype.formatNegativeDecimal=function(t,e,n){return"-".concat(this.formatDecimal(t,e,n))},t.prototype.formatExponent=function(t,e,n,o){return void 0===e&&(e=i.exponentDefaultPlaces),void 0===n&&(n=function(t,e){return t.toString()}),void 0===o&&(o=Math.max(2,e)),b(t)?n(t,Math.max(e,1)):v(t)?(u=n(t,0),(f=u.toString().split("."))[0]=f[0].replace(/\w+$/g,a),f.join(".")):this.formatDecimal(new r.default(t),o,o);var u,f},t}(),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Greek Letters"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"greek",{get:function(){return"άαβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ".split("")},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){for(var n=Math.floor(t.e/3),o=Math.pow(this.greek.length,Math.floor(Math.log(n)/Math.log(this.greek.length))),i="";o>=1;){var a=Math.floor(n/o);i+=this.greek[a],n-=o*a,o/=this.greek.length}var u=r.default.pow(10,r.default.log10(t)%3).toFixed(e);return"".concat(u," ").concat(i)},e}(P),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Omega"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"greek",{get:function(){return"βζλψΣΘΨω"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"Ω"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.formatDecimal(new r.default(t))},e.prototype.formatDecimal=function(t){var e=r.default.floor(t.div(1e3)),n=r.default.floor(e.div(this.greek.length)),o=this.greek[e.toNumber()%this.greek.length]+p(t.toNumber()%1e3);(void 0===this.greek[e.toNumber()%this.greek.length]||e.toNumber()>Number.MAX_SAFE_INTEGER)&&(o="ω");var i=r.default.log(t,8e3);if(n.equals(0))return o;if(n.gt(0)&&n.lte(3)){for(var a=[],u=0;uNumber.MAX_SAFE_INTEGER)&&(o="ω");var i=r.default.log(t,8e3);if(n.equals(0))return o;if(n.gt(0)&&n.lte(2)){for(var a=[],u=0;u1&&o})),i=n.map((function(n,i){return e.maybeParenthesize(i===t.length-1&&o?h(n[0]):e.formatFromList(n),r[i])}));if(o){var a=i.pop();i[t.length-2]+=a}return i.join("^")},e.prototype.formatFromList=function(t){for(var e=[],n=0,o=0,r=0,i=t;r0&&(o>1?e.push("".concat(n).concat(h(o))):e.push(n)),n=a,o=1)}return o>1?e.push("".concat(n).concat(h(o))):e.push(n),e.join("×")},e.prototype.primesFromInt=function(t){for(var e=t,n=[],o=0,r=[2,3];o1&&n.push(e),n},e}(P),I=["","万","億","兆","京","垓","秭","穣","溝","澗","正","載","極","恒河沙","阿僧祇","那由他","不可思議","無量大数"],F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Japanese"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"無限"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){return t.exponent<72?this.jpnNotation(t):"".concat(t.mantissa.toFixed(e),"×10の").concat(this.jpnNotation(new r.default(t.exponent)),"乗")},e.prototype.getSuffix=function(t){return I[t]},e.prototype.jpnNotation=function(t){var e=Math.max(0,Math.floor(t.exponent/4)),n=r.default.times(r.default.pow(10,t.exponent-4*e),t.mantissa).toFixed(4),o=r.default.floor(n),i=r.default.times(r.default.minus(n,o),1e4),a="".concat(o.toString()).concat(this.getSuffix(e));return e>=1&&i.neq(0)&&(a+="".concat(i.toString()).concat(this.getSuffix(e-1))),a},e}(P),U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Tritetrated"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"Infinity"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.tritetrated(new r.default(t))},e.prototype.formatDecimal=function(t){return this.tritetrated(t)},e.prototype.tritetrated=function(t){for(var e=0,n=16;n-e>1e-7;){var o=(e+n)/2;r.default.pow(o,Math.pow(o,o)).lt(t)?e=o:n=o}return"".concat(e.toFixed(4),"↑↑3")},e}(P),C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Engineering"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,n){return x(M,this.formatExponent.bind(this),10,3,!1)(t,e,n)},e}(P),k=function(t){function e(e,n,o){void 0===n&&(n=""),void 0===o&&(o="");var r=this;if(e.length<2)throw new Error("The supplied letter sequence must contain at least 2 letters");return(r=t.call(this)||this).letters=e,r.mantissaExponentSeparator=n,r.separator=o,r}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Custom"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){var n=f(t);return n.mantissa.toFixed(e)+this.mantissaExponentSeparator+this.transcribe(n.exponent).join(this.separator)},e.prototype.transcribe=function(t){var e=t/3,n=this.letters.length;if(e<=n)return[this.letters[e-1]];for(var o=[];e>n;){var r=e%n,i=(0===r?n:r)-1;o.push(this.letters[i]),e=(e-r)/n,0===r&&e--}return o.push(this.letters[e-1]),o.reverse()},e}(C),T=["🇦🇫","🇦🇩","🇦🇪","🇦🇫","🇦🇬","🇦🇮","🇦🇱","🇦🇲","🇦🇴","🇦🇶","🇦🇷","🇦🇸","🇦🇹","🇦🇺","🇦🇼","🇦🇽","🇦🇿","🇧🇦","🇧🇧","🇧🇩","🇧🇪","🇧🇫","🇧🇬","🇧🇭","🇧🇮","🇧🇯","🇧🇱","🇧🇲","🇧🇳","🇧🇴","🇧🇶","🇧🇷","🇧🇸","🇧🇹","🇧🇻","🇧🇼","🇧🇾","🇧🇿","🇨🇦","🇨🇨","🇨🇩","🇨🇫","🇨🇬","🇨🇭","🇨🇮","🇨🇰","🇨🇱","🇨🇲","🇨🇳","🇨🇴","🇨🇵","🇨🇷","🇨🇺","🇨🇻","🇨🇼","🇨🇽","🇨🇾","🇨🇿","🇩🇪","🇩🇬","🇩🇯","🇩🇰","🇩🇲","🇩🇴","🇩🇿","🇪🇦","🇪🇨","🇪🇪","🇪🇬","🇪🇭","🇪🇷","🇪🇸","🇪🇹","🇪🇺","🇫🇮","🇫🇯","🇫🇰","🇫🇲","🇫🇴","🇫🇷","🇬🇦","🇬🇧","🇬🇩","🇬🇪","🇬🇫","🇬🇬","🇬🇭","🇬🇮","🇬🇱","🇬🇲","🇬🇳","🇬🇵","🇬🇶","🇬🇷","🇬🇸","🇬🇹","🇬🇺","🇬🇼","🇬🇾","🇭🇰","🇭🇲","🇭🇳","🇭🇷","🇭🇹","🇭🇺","🇮🇨","🇮🇩","🇮🇪","🇮🇱","🇮🇲","🇮🇳","🇮🇴","🇮🇶","🇮🇷","🇮🇸","🇮🇹","🇯🇪","🇯🇲","🇯🇴","🇯🇵","🇰🇪","🇰🇬","🇰🇭","🇰🇮","🇰🇲","🇰🇳","🇰🇵","🇰🇷","🇰🇼","🇰🇾","🇰🇿","🇱🇦","🇱🇧","🇱🇨","🇱🇮","🇱🇰","🇱🇷","🇱🇸","🇱🇹","🇱🇺","🇱🇻","🇱🇾","🇲🇦","🇲🇨","🇲🇩","🇲🇪","🇲🇫","🇲🇬","🇲🇭","🇲🇰","🇲🇱","🇲🇲","🇲🇳","🇲🇴","🇲🇵","🇲🇶","🇲🇷","🇲🇸","🇲🇹","🇲🇺","🇲🇻","🇲🇼","🇲🇽","🇲🇾","🇲🇿","🇳🇦","🇳🇨","🇳🇪","🇳🇫","🇳🇬","🇳🇮","🇳🇱","🇳🇴","🇳🇵","🇳🇷","🇳🇺","🇳🇿","🇴🇲","🇵🇦","🇵🇪","🇵🇫","🇵🇬","🇵🇭","🇵🇰","🇵🇱","🇵🇲","🇵🇳","🇵🇷","🇵🇸","🇵🇹","🇵🇼","🇵🇾","🇶🇦","🇷🇪","🇷🇴","🇷🇸","🇷🇺","🇷🇼","🇸🇦","🇸🇧","🇸🇨","🇸🇩","🇸🇪","🇸🇬","🇸🇭","🇸🇮","🇸🇯","🇸🇰","🇸🇱","🇸🇲","🇸🇳","🇸🇴","🇸🇷","🇸🇸","🇸🇹","🇸🇻","🇸🇽","🇸🇾","🇸🇿","🇹🇦","🇹🇨","🇹🇩","🇹🇫","🇹🇬","🇹🇭","🇹🇯","🇹🇰","🇹🇱","🇹🇲","🇹🇳","🇹🇴","🇹🇷","🇹🇹","🇹🇻","🇹🇼","🇹🇿","🇺🇦","🇺🇬","🇺🇲","🇺🇳","🇺🇸","🇺🇾","🇺🇿","🇻🇦","🇻🇨","🇻🇪","🇻🇬","🇻🇮","🇻🇳","🇻🇺","🇼🇫","🇼🇸","🇽🇰","🇾🇪","🇾🇹","🇿🇦","🇿🇲","🇿🇼"],q=function(t){function e(){return t.call(this,T)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Flags"},enumerable:!1,configurable:!0}),e}(k),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"YesNo"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"negativeInfinite",{get:function(){return"YES"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"YES"},enumerable:!1,configurable:!0}),e.prototype.formatVerySmallNegativeDecimal=function(t){return t.neq(0)?"YES":"NO"},e.prototype.formatVerySmallDecimal=function(t){return t.neq(0)?"YES":"NO"},e.prototype.formatNegativeUnder1000=function(t){return 0!==t?"YES":"NO"},e.prototype.formatUnder1000=function(t){return 0!==t?"YES":"NO"},e.prototype.formatNegativeDecimal=function(t){return t.neq(0)?"YES":"NO"},e.prototype.formatDecimal=function(t){return t.neq(0)?"YES":"NO"},e}(P),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Scientific"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,n){return x(M,this.formatExponent.bind(this),10,1,!1)(t,e,n)},e}(P),L=new V,H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Evil"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){var n=Math.log(t.log(2))/Math.log(2),o=Math.round(n),i=new r.default;return i=o<6||Math.abs(n-o)>.25?t:t.pow(o%2==0?2:.5),L.format(i,e)},e}(P),R=new V,Y=["🎂","🎄","💀","👪","🌈","💯","🎃","💋","😂","🌙"],Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Emojier"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t,e){return this.affect(R.formatUnder1000(t,e))},e.prototype.formatDecimal=function(t,e,n){return this.affect(R.formatDecimal(t,e,n))},e.prototype.affect=function(t){for(var e=t.split(""),n=[],o=0;o0?this.formatUnder10000(o)+z[e/4-1]:"")},e.prototype.formatUnder10000WithPlaces=function(t){return"".concat(this.formatUnder1000(t),"點").concat([1,2,3].map((function(e){return G[Math.floor(t*Math.pow(10,e))%10]})).join(""))},e.prototype.formatUnder10000=function(t){return[3,2,1,0].map((function(e){var n=Math.floor(t/Math.pow(10,e))%10;return 0===n?"":1===n&&1===e?Q[e]:G[n]+Q[e]})).join("")||G[0]},e}(P),$=[["H"],["He","Li","Be","B","C","N","O","F"],["Ne","Na","Mg","Al","Si","P","S","Cl"],["Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br"],["Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I"],["Xe","Cs","Ba","La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At"],["Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Db","Sg","Bh","Hs","Mt","Ds","Rg","Cn","Nh","Fl","Mc","Lv","Ts"],["Og"]],K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Elemental"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"Infinity"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t,e){return this.elemental(new r.default(t),e)},e.prototype.formatDecimal=function(t,e){return this.elemental(t,e)},e.prototype.getAbbreviationAndValue=function(t){var e=Math.log(t)/Math.log(118),n=Math.floor(e),o=$[Math.floor(n)],r=Math.floor((e-n)*o.length);return[o[r],Math.pow(118,n+r/o.length)]},e.prototype.formatElementalPart=function(t,e){return 1===e?t:"".concat(e," ").concat(t)},e.prototype.elemental=function(t,e){for(var n=this,o=t.log(118),i=[];o>=1&&i.length<4;){var a=this.getAbbreviationAndValue(o),u=a[0],f=a[1],c=Math.floor(o/f);o-=c*f,i.unshift([u,c])}if(i.length>=4)return i.map((function(t){return n.formatElementalPart(t[0],t[1])})).join(" + ");var l=r.default.pow(118,o).toFixed(e);return 0===i.length?l:1===i.length?"".concat(l," × ").concat(this.formatElementalPart(i[0][0],i[0][1])):"".concat(l," × (").concat(i.map((function(t){return n.formatElementalPart(t[0],t[1])})).join(" + "),")")},e}(P),W=function(t){function e(e,n,o){var r=this;if(e.length<2)throw new Error("The supplied digits must contain at least 2 digits");return(r=t.call(this)||this).formatBase=e.length,r.digits=e,r.exponentBase=n,r.useLogIfExponentIsFormatted=o,r}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Custom Base"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t,e){return N(this.formatBase,this.digits)(t,e)},e.prototype.formatDecimal=function(t,e,n){var o=this;return x(N(this.formatBase,this.digits),(function(t,e){return o.formatExponent(t,e,(function(t,e){return N(o.formatBase,o.digits)(t,0)}))}),this.exponentBase,1,this.useLogIfExponentIsFormatted)(t,e,n)},e}(P),J=function(t){function e(){return t.call(this,"01",2,!1)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Binary"},enumerable:!1,configurable:!0}),e}(W),tt=function(t){function e(){return t.call(this,"0123456789ABCDEF",16,!1)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Hexadecimal"},enumerable:!1,configurable:!0}),e}(W),et=Math.log(69),nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Haha Funny"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t){if(t.eq(0))return"42069";if(t.lt(1))return this.formatDecimal(t.pow(-1)).split("").reverse().join("");for(var e=Math.LN10/et*t.log10(),n=Math.floor(e*Math.pow(69,2)),o=[];n>0||o.length<3;){var r=n%69;n=Math.floor(n/69),o.push((r+1).toString())}return o.join("")},Object.defineProperty(e.prototype,"infinite",{get:function(){return"69420"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.formatDecimal(new r.default(t))},e}(P),ot=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Nice"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){return t.log(69).toFixed(Math.max(2,e)).replace("-","^")},Object.defineProperty(e.prototype,"infinite",{get:function(){return"69420"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t,e){return this.formatDecimal(new r.default(t),e)},e}(P),rt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Long scale",e}return n.__extends(e,t),e.prototype.formatDecimal=function(t,e){var n=c(t,e),o=n.mantissa.toFixed(e),r=d(Math.floor(n.exponent/6)+1);return"".concat(o," ").concat(r).replace(/[,.]/g,(function(t){return"."===t?",":"."}))},e}(P),it=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Abstract Infix",e.groupDigits=3,e.canHandleZeroExponent=!0,e}return n.__extends(e,t),e.prototype.formatDecimal=function(t,e,n){return this.formatInfix(t,e)},e.prototype.format=function(t,e,n,o){if(void 0===e&&(e=0),void 0===o&&(o=e),"number"==typeof t&&!Number.isFinite(t))return this.infinite;var a=r.default.fromValue_noAlloc(t);return i.isInfinite(a.abs())?a.sign()<0?this.negativeInfinite:this.infinite:a.sign()<0?this.formatNegativeDecimal(a.abs(),e,o):this.formatDecimal(a,e,o)},e.prototype.formatInfix=function(t,e){var n=u(t,this.numberOfPlaces(t,e),10,1),o=this.numberOfPlaces(n,e),r=n.mantissa.toFixed(o).replace(".",""),i=[],a=!1;-1===n.exponent&&(this.canHandleZeroExponent?i.push(this.formatExponent(0)):i.push("."));for(var f=0;f=0&&t=0?Math.min(n,n=1e3,i=r?1:n.mantissa+o/2,a=n.exponent+(r?1:0),c=this.formatUnits(i,e),l=this.formatPrefixes(a);return"".concat(c," ").concat(l)},e.prototype.formatUnits=function(t,e){var n=[],o=t,r=Math.pow(10,-e);if(t>=100){var i=Math.floor(t/100);n.push("".concat(lt[i]," hundred")),t-=100*i}if(t<20){t>=1&&n.length>0&&n.push("and");i=Math.floor(t);n.push(t<1&&o>1?"":lt[i]),t-=i}else{n.length>0&&n.push("and");i=Math.floor(t/10);n.push(pt[i]),t-=10*i,0!==(i=Math.floor(t))&&(n.push(lt[i]),t-=i)}if(t>=Math.pow(10,-e)&&e>0){n.push("point");for(i=0;t>=r&&i=10;)t=Math.floor(t/10),n.push(st[++e%3][t%10]);for(e=Math.floor(e/3);n.length%3!=0;)n.push("");for(var o="";e>=0;){if("un"!==n[3*e]||""!==n[3*e+1]||""!==n[3*e+2]||0===e){var r=n[3*e+1]+n[3*e+2];["tre","se"].includes(n[3*e])&&["v","t","q"].includes(r.substr(0,1))&&(r="s".concat(r)),"se"===n[3*e]&&["c","o"].includes(r.substr(0,1))&&(r="x".concat(r)),["septe","nove"].includes(n[3*e])&&["v","o"].includes(r.substr(0,1))&&(r="m".concat(r)),["septe","nove"].includes(n[3*e])&&["d","c","t","q","s"].includes(r.substr(0,1))&&(r="n".concat(r)),o+=n[3*e]+r}""===n[3*e]&&""===n[3*e+1]&&""===n[3*e+2]||(o+=ht[e]),e--}return o=o.replace(/-$/,""),"".concat(o,"illion").replace("i-illion","illion").replace("iillion","illion").replace("aillion","illion").replace("oillion","illion").replace("eillion","illion").replace("unillion","untillion").replace("duillion","duotillion").replace("trillion","tretillion").replace("quattuorillion","quadrillion").replace("quinillion","quintillion").replace("sillion","sextillion").replace("novillion","nonillion")},e}(C),gt=Math.log10(4),yt=["4-4","4÷4","√4","4-4÷4","4","4+4÷4","4!÷4","(4!+4)÷4","4+4","4+4+4÷4","4!÷4+4","44÷4","4!÷√4","44÷4+√4","4×4-√4","4×4-4÷4"],dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Fours"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"negativeInfinite",{get:function(){return"-∞"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"∞"},enumerable:!1,configurable:!0}),e.prototype.formatVerySmallNegativeDecimal=function(t){return this.formatNegativeDecimal(t)},e.prototype.formatVerySmallDecimal=function(t){return this.formatDecimal(t)},e.prototype.formatNegativeUnder1000=function(t){var e=this.formatUnder1000(t);return"-".concat(this.bracketify(e))},e.prototype.formatUnder1000=function(t){var e=Math.log10(t);return 0===t?yt[0]:e<0?this.formatAsFraction(new r.default(t)):this.formatAsInteger(t)},e.prototype.formatNegativeDecimal=function(t){var e=this.formatDecimal(t);return"-".concat(this.bracketify(e))},e.prototype.formatDecimal=function(t){if(t.sign()<0)return this.formatNegativeDecimal(r.default.minus(0,t));var e=t.log10(),n=Math.abs(e);return n>=24?this.formatAsPow(t):n>=3?this.formatAsRoot(t):this.formatUnder1000(t.toNumber())},e.prototype.formatAsPow=function(t){var e=t.log10()/gt,n=this.formatDecimal(new r.default(e));return"4^".concat(this.bracketify(n))},e.prototype.formatAsRoot=function(t){var e=r.default.sqrt(t),n=this.formatDecimal(e);return"(".concat(n,")^").concat(yt[2])},e.prototype.formatAsInteger=function(t){if(t>=16){var e=Math.floor(t/16),n=Math.floor(Math.max(0,Math.min(15,t-16*e))),o=0===n?"":"".concat(yt[Math.floor(n)],"+"),r=1===e?"":"×".concat(this.multiBracketify(this.formatAsInteger(e)));return"".concat(o,"4×4").concat(r)}return yt[Math.floor(t)]},e.prototype.formatAsFraction=function(t){var e=r.default.div(4,t),n=this.formatDecimal(e);return"4÷".concat(this.bracketify(n))},e.prototype.bracketify=function(t){return"^"!==(t.match(/[\+\-\×÷\^]/)||["^"])[0]?"(".concat(t,")"):t},e.prototype.multiBracketify=function(t){for(var e=0,n=0;n=1&&(n="-".concat(r[0]+1)),this.blobConstructor(e+this.prefixes[Math.floor(r[1])],this.suffixes[Math.floor(r[2])]+n)},e.prototype.blobConstructor=function(t,e){return":".concat(t,"blob").concat(e,":")},e}(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Blobs"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"".concat("")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"negativeInfinite",{get:function(){return"".concat("").concat("")},enumerable:!1,configurable:!0}),e.prototype.formatNegativeUnder1000=function(t){return"".concat("").concat(this.blobify(new r.default(t-1)))},e.prototype.formatNegativeDecimal=function(t){return"".concat("").concat(this.blobify(t.minus(1)))},e.prototype.formatUnder1000=function(t){return this.blobify(new r.default(t))},e.prototype.formatDecimal=function(t){return this.blobify(t)},e.prototype.blobify=function(t){var e=this.reduceNumber(t.abs());return e<23?vt[Math.floor(e)]:Math.floor(e/23)<24?vt[Math.floor(e/23)-1]+vt[Math.floor(e%23)]:this.blobify(r.default.floor(e/23-1))+vt[Math.floor(e%23)]},e.prototype.reduceNumber=function(t){return t.lte(1e3)?t.toNumber():(Math.log10(t.log10())-Nt)/Math.log10(1.0002)+1e3},e}(P)),Pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Blobs (Short Text)"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prefixNegative",{get:function(){return"un"},enumerable:!1,configurable:!0}),e.prototype.blobify=function(t){var e="",n="",o=this.reduceNumber(t.abs());-1===t.sign()&&(e=this.prefixNegative,o=Math.max(0,o-1));var r=[Math.floor(o/this.suffixes.length),o%this.suffixes.length];return r[0]>=1&&(n="-".concat(r[0]+1)),this.blobConstructor(e,this.suffixes[Math.floor(r[1])]+n)},e}(Dt);t.BinaryNotation=J,t.BlobsShortTextNotation=Pt,t.BlobsTextNotation=Dt,t.ChineseNotation=X,t.CustomBaseNotation=W,t.ElementalNotation=K,t.EmojierNotation=Z,t.EnglishNotation=mt,t.EvilNotation=H,t.FlagsNotation=q,t.FoursNotation=dt,t.GreekLettersNotation=j,t.HahaFunnyNotation=nt,t.HexadecimalNotation=tt,t.InfixEngineeringNotation=at,t.InfixEngineeringReverseNotation=ut,t.InfixLongScaleNotation=ct,t.InfixShortScaleNotation=ft,t.JapaneseNotation=F,t.LongScaleNotation=rt,t.NiceNotation=ot,t.Notation=P,t.OmegaNotation=_,t.OmegaShortNotation=O,t.PrecisePrimeNotation=A,t.Settings=i,t.TritetratedNotation=U,t.YesNoNotation=B,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/docs/ad-notations.min.js b/docs/ad-notations.min.js index 8bfdbd9..09ef49b 100644 --- a/docs/ad-notations.min.js +++ b/docs/ad-notations.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("break_infinity.js"),require("tslib")):"function"==typeof define&&define.amd?define(["exports","break_infinity.js","tslib"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ADNotations={},t.Decimal,t.tslib)}(this,(function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=n(e),i={isInfinite:function(t){return t.gte(o.default.MAX_VALUE)},exponentCommas:{show:!0,min:1e5,max:1e9},exponentDefaultPlaces:3};function a(t){return Array.from(Array(Math.ceil(t.length/3))).map((function(e,r){return function(t,e){return 0===e?t.slice(-3):t.slice(-3*(e+1),-3*e)}(t,r)})).reverse().join(",")}function u(t){var e=t.toString().split(".");return e[0]=e[0].replace(/\w+$/g,a),e.join(".")}var f=["K","M","B","T","Qa","Qt","Sx","Sp","Oc","No"],c=[["","U","D","T","Qa","Qt","Sx","Sp","O","N"],["","Dc","Vg","Tg","Qd","Qi","Se","St","Og","Nn"],["","Ce","Dn","Tc","Qe","Qu","Sc","Si","Oe","Ne"]],l=["","MI-","MC-","NA-","PC-","FM-","AT-","ZP-"];function p(t){var e=t-1;if(-1===e)return"";if(e0;)r.push(c[r.length%3][n%10]),n=Math.floor(n/10);for(;r.length%3!=0;)r.push("");for(var o="",i=r.length/3-1;i>=0;i--)o+=r.slice(3*i,3*i+3).join("")+l[i];return o.replace(/-[A-Z]{2}-/g,"-").replace(/U([A-Z]{2}-)/g,"$1").replace(/-$/,"")}function s(t){return tr;){var o=e%r,i=(0===o?r:o)-1;n.push(this.letters[i]),e=(e-o)/r,0===o&&e--}return n.push(this.letters[e-1]),n.reverse()},e}(b),M=function(t){function e(){return t.call(this,"abcdefghijklmnopqrstuvwxyz")||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Letters"},enumerable:!1,configurable:!0}),e}(v),x=["😠","🎂","🎄","💀","🍆","👪","🌈","💯","🍦","🎃","💋","😂","🌙","⛔","🐙","💩","❓","☢","🙈","👍","☂","✌","⚠","❌","😋","⚡"],D=function(t){function e(){return t.call(this,x)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Emoji"},enumerable:!1,configurable:!0}),e}(v),N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Standard",e}return r.__extends(e,t),e.prototype.formatDecimal=function(t,e,r){return h(d,p,1e3,1,!1," ",!0)(t,e,r)},e}(y),w=new N,O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Mixed scientific"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,r){return t.exponent<33?w.formatDecimal(t,e,r):h(d,this.formatExponent.bind(this),10,1,!1)(t,e,r)},e}(y),j=new N,_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Mixed engineering"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,r){return t.exponent<33?j.formatDecimal(t,e,r):h(d,this.formatExponent.bind(this),10,3,!1)(t,e,r)},e}(y),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Logarithm"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,r){var n=t.log10();return"e".concat(this.formatExponent(n,e,(function(t,e){return t.toFixed(e)}),r))},e}(y),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Brackets"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t){for(var e=[")","[","{","]","(","}"],r=Math.LN10/Math.log(6)*t.log10(),n=Math.floor(r),o=r-n,i=Math.floor(36*o),a="";n>=6;){var u=n%6;n-=u,n/=6,a=e[u]+a}return a="e".concat(e[n]).concat(a,"."),a+=e[Math.floor(i/6)],a+=e[i%6]},e}(y),A=Math.log10(Number.MAX_VALUE),F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Infinity"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){var r=t.log10()/A,n=r<1e3?4:3,o=r.toFixed(Math.max(n,e));return i.exponentCommas.show?"".concat(u(o),"∞"):"".concat(o,"∞")},e}(y),U=[[1e6,"M̄"],[9e5,"C̄M̄"],[5e5,"D̄"],[4e5,"C̄D̄"],[1e5,"C̄"],[9e4,"X̄C̄"],[5e4,"L̄"],[4e4,"X̄L̄"],[1e4,"X̄"],[9e3,"ⅯX̄"],[5e3,"V̄"],[4e3,"ⅯV̄"],[1e3,"Ⅿ"],[900,"ⅭⅯ"],[500,"Ⅾ"],[400,"ⅭⅮ"],[100,"Ⅽ"],[90,"ⅩⅭ"],[50,"Ⅼ"],[40,"ⅩⅬ"],[10,"Ⅹ"],[9,"ⅠⅩ"],[5,"Ⅴ"],[4,"ⅠⅤ"],[1,"Ⅰ"]],L=["","·",":","∴","∷","⁙"],E=Math.log10(4e6),I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Roman"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"Infinitus"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.romanize(t)},e.prototype.formatDecimal=function(t){if(t.lt(4e6))return this.romanize(t.toNumber());var e=t.log10()/E,r=Math.pow(4e6,e-Math.floor(e));return"".concat(this.romanize(r),"↑").concat(this.formatDecimal(new o.default(e)))},e.prototype.romanize=function(t){for(var e="",r=0,n=U;r5&&(u-=6,e+="S"),e+=L[u])},e}(y),C="⠀⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿⡀⡁⡂⡃⡄⡅⡆⡇⡈⡉⡊⡋⡌⡍⡎⡏⡐⡑⡒⡓⡔⡕⡖⡗⡘⡙⡚⡛⡜⡝⡞⡟⡠⡡⡢⡣⡤⡥⡦⡧⡨⡩⡪⡫⡬⡭⡮⡯⡰⡱⡲⡳⡴⡵⡶⡷⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⢈⢉⢊⢋⢌⢍⢎⢏⢐⢑⢒⢓⢔⢕⢖⢗⢘⢙⢚⢛⢜⢝⢞⢟⢠⢡⢢⢣⢤⢥⢦⢧⢨⢩⢪⢫⢬⢭⢮⢯⢰⢱⢲⢳⢴⢵⢶⢷⢸⢹⢺⢻⢼⢽⢾⢿⣀⣁⣂⣃⣄⣅⣆⣇⣈⣉⣊⣋⣌⣍⣎⣏⣐⣑⣒⣓⣔⣕⣖⣗⣘⣙⣚⣛⣜⣝⣞⣟⣠⣡⣢⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾⣿",V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Dots"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"⣿⠀⣿"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.dotify(254*t)},e.prototype.formatDecimal=function(t){if(t.lt(16387063.9980315))return this.dotify(254*t.toNumber());var e=t.log(254),r=Math.floor(e-2),n=Math.pow(254,e-r);return"".concat(this.dotify(r),"⣿").concat(this.dotify(254*n))},e.prototype.dotify=function(t,e){void 0===e&&(e=!1);var r=Math.round(t);return!e&&r<254?C[r+1]:r<64516?C[Math.floor(r/254)+1]+C[r%254+1]:this.dotify(Math.floor(r/64516))+this.dotify(r%64516,!0)},e}(y),k=["̍","̶","͓","̿","҉","̰","̚","̸","͚","̷"],B=["H","E"," ","C","O","M","E","S"];for(var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Zalgo"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return B.map((function(t){return t+(e=k)[Math.floor(Math.random()*e.length)];var e})).join("")},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.heComes(new o.default(t))},e.prototype.formatDecimal=function(t){return this.heComes(t)},e.prototype.heComes=function(t){for(var e=t.plus(1).log10()/66666*1e3,r=Number(e.toFixed(2)),n=Math.floor(Math.abs(Math.pow(2,30)*(e-r))),o=Array.from(u(r)),i=Array.from(n.toString()+e.toFixed(0)),a=0;a0||0===r&&a%2==1)&&(a+=1),a},e}(y),z=[[0,"pL",0],[61611520,"minim",0],[3696691200,"dram",1],[29573529600,"ounce",2],[118294118400,"gill",2],[236588236800,"cup",3],[473176473600,"pint",4],[946352947200,"quart",4],[3785411788800,"gallon",4],[0xf7e1e900000,"pin",3],[34068706099200,"firkin",3],[68137412198400,"kilderkin",4],[0x7bf0f4800000,"barrel",4],[0xb9e96ec00000,"hogshead",5],[0xf7e1e9000000,"puncheon",6],[408824473190400,"butt",7],[817648946380800,"tun",7]],Z=z[1],G=["minute ","tiny ","petite ","small ","modest ","medium ","generous ","large ","great ","grand ","huge ","gigantic ","immense ","colossal ","vast ","galactic ","cosmic ","infinite ","eternal "],H=new Set("aeiouAEIOU"),R=10*z[z.length-1][0],$=Math.log10(R),K=Math.log10(R/Z[0]),W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Imperial"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.formatDecimal(new o.default(t))},e.prototype.formatDecimal=function(t){if(t.lt(R))return this.convertToVolume(t.toNumber(),G[0]);for(var e=t.log10()-$,r=1;e>K;)r++,e/=K;return this.convertToVolume(Math.pow(10,e)*Z[0],G[r])},e.prototype.convertToVolume=function(t,e){var r=this.findVolumeUnit(t);if(0===r)return this.formatMetric(t);var n=this.checkSmallUnits(e,t,r);if(void 0!==n)return n;var o=z[r],i=Math.floor(t/o[0]),a=t-i*o[0];if(r0&&s>r-o[2];--s){var m=z[s],h=Math.floor(a/m[0]);if(h>9&&1!==s)break;var d=a-h*m[0];d<.99*p&&(c=h,l=s,p=d)}return this.bigAndSmall(e,i,o,c,z[l])},e.prototype.formatMetric=function(t){return t<1e3?"".concat(t<10||t===Math.round(t)?t.toFixed(2):t.toFixed(0),"pL"):t<1e6?"".concat((t/1e3).toPrecision(4),"nL"):"".concat((t/1e6).toPrecision(4),"μL")},e.prototype.checkSmallUnits=function(t,e,r){var n=z[r];if(r<=3&&e+9.5*Z[0]>z[r+1][0])return this.almostOrShortOf(e,t,1,z[r+1],Z);if(1===r){var o=Math.round(10*e/n[0]);return 10===o?this.addArticle(t+n[1]):"".concat((o/10).toFixed(o<100?1:0)," ").concat(t).concat(n[1],"s")}if(2===r){var i=Math.floor(e/n[0]),a=e-i*n[0];if(a>50.5*Z[0])return this.almostOrShortOf(e,t,i+1,n,Z);var u=Math.round(a/Z[0]);return this.bigAndSmall(t,i,n,u,Z)}},e.prototype.findVolumeUnit=function(t){for(var e=0,r=z.length,n=0;r-e>1;)n=Math.floor((e+r)/2),z[n][0]>t?r=n:e=n;return e},e.prototype.checkAlmost=function(t,e,r,n){var o=z[n];if(e+z[n-o[2]][0]>=o[0])return this.almost(t,r+1,o);var i=z[n+1-o[2]];return e+i[0]>=o[0]?this.shortOf(t,r+1,o,1,i):void 0},e.prototype.bigAndSmall=function(t,e,r,n,o){var i=this.pluralOrArticle(e,t+r[1]);return 0===n?i:"".concat(i," and ").concat(this.pluralOrArticle(n,o[1]))},e.prototype.almost=function(t,e,r){return"almost ".concat(this.pluralOrArticle(e,t+r[1]))},e.prototype.almostOrShortOf=function(t,e,r,n,o){var i=Math.round((r*n[0]-t)/o[0]);return 0===i?this.almost(e,r,n):this.shortOf(e,r,n,i,o)},e.prototype.shortOf=function(t,e,r,n,o){return"".concat(this.pluralOrArticle(n,o[1])," short of ").concat(this.pluralOrArticle(e,t+r[1]))},e.prototype.pluralOrArticle=function(t,e){return 1===t?this.addArticle(e):"".concat(t," ").concat(e,"s")},e.prototype.addArticle=function(t){return(H.has(t[0])?"an ":"a ")+t},e}(y),J=["🕛","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚"],Y=Math.log10(12),tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Clock"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"🕛🕡"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.clockwise(new o.default(t))},e.prototype.formatDecimal=function(t){return this.clockwise(t)},e.prototype.clockwise=function(t){if(t.lt(12))return this.hour(t.toNumber());var e=t.log10()/Y,r=Math.floor(e);if(e<301){var n=(Math.pow(12,e-r+1)-12)/11;if(r<13)return this.hour(r-1)+this.hour(n);var o="";return(r-=13)>=144&&(o=this.hour(0),r-=144),o+this.hour(r/12)+this.hour(r%12)+this.hour(n)}r-=301;for(var i=1;r>=1728;)r=(r-1728)/12,++i;return this.hour(i)+this.hour(r/144)+this.hour(r%144/12)+this.hour(r%12)},e.prototype.hour=function(t){return J[Math.max(Math.min(Math.floor(t),11),0)]},e}(y),et=new o.default(10006),rt=Math.log10(10006),nt=[],ot=new Array(10006).fill(!1),it=Math.ceil(Math.sqrt(10006)),at=2;at0&&(n>1?e.push("".concat(r).concat(pt[n])):e.push(r)),r=t[o],n=1),o===t.length-1&&(n>1?e.push("".concat(t[o]).concat(pt[n])):e.push(t[o]));return e.join("×")},e.prototype.findGreatestLtePrimeIndex=function(t){if(t>=lt)return ct;for(var e=0,r=ct;r!==e+1;){var n=Math.floor((r+e)/2),o=nt[n];if(o===t)return n;t=8;){var u=r%8;r=(r-u)/8,a.push(mt[u])}return a.push(mt[r]),a.join("")},e.prototype.flipBars=function(t){for(var e=[],r=0,n=t;r0||0===i.length;)i.push(e[o%t]),o=Math.floor(o/t);var a=i.reverse().join("");return n>0&&(a=a.padStart(n+1,"0"),a="".concat(a.slice(0,-n),".").concat(a.slice(-n))),a}},t.formatMantissaBaseTen=d,t.formatMantissaWithExponent=h,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("break_infinity.js"),require("tslib")):"function"==typeof define&&define.amd?define(["exports","break_infinity.js","tslib"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ADNotations={},t.Decimal,t.tslib)}(this,(function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=n(e),i={isInfinite:function(t){return t.gte(o.default.MAX_VALUE)},exponentCommas:{show:!0,min:1e5,max:1e9},exponentDefaultPlaces:3};function a(t){return Array.from(Array(Math.ceil(t.length/3))).map((function(e,r){return function(t,e){return 0===e?t.slice(-3):t.slice(-3*(e+1),-3*e)}(t,r)})).reverse().join(",")}function u(t){var e=t.toString().split(".");return e[0]=e[0].replace(/\w+$/g,a),e.join(".")}var f=["K","M","B","T","Qa","Qt","Sx","Sp","Oc","No"],c=[["","U","D","T","Qa","Qt","Sx","Sp","O","N"],["","Dc","Vg","Tg","Qd","Qi","Se","St","Og","Nn"],["","Ce","Dn","Tc","Qe","Qu","Sc","Si","Oe","Ne"]],l=["","MI-","MC-","NA-","PC-","FM-","AT-","ZP-"];function p(t){var e=t-1;if(-1===e)return"";if(e0;)r.push(c[r.length%3][n%10]),n=Math.floor(n/10);for(;r.length%3!=0;)r.push("");for(var o="",i=r.length/3-1;i>=0;i--)o+=r.slice(3*i,3*i+3).join("")+l[i];return o.replace(/-[A-Z]{2}-/g,"-").replace(/U([A-Z]{2}-)/g,"$1").replace(/-$/,"")}function s(t){return tr;){var o=e%r,i=(0===o?r:o)-1;n.push(this.letters[i]),e=(e-o)/r,0===o&&e--}return n.push(this.letters[e-1]),n.reverse()},e}(b),M=function(t){function e(){return t.call(this,"abcdefghijklmnopqrstuvwxyz")||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Letters"},enumerable:!1,configurable:!0}),e}(v),x=["😠","🎂","🎄","💀","🍆","👪","🌈","💯","🍦","🎃","💋","😂","🌙","⛔","🐙","💩","❓","☢","🙈","👍","☂","✌","⚠","❌","😋","⚡"],D=function(t){function e(){return t.call(this,x)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Emoji"},enumerable:!1,configurable:!0}),e}(v),N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Standard",e}return r.__extends(e,t),e.prototype.formatDecimal=function(t,e,r){return h(d,p,1e3,1,!1," ",!0)(t,e,r)},e}(y),w=new N,O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Mixed scientific"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,r){return t.exponent<33?w.formatDecimal(t,e,r):h(d,this.formatExponent.bind(this),10,1,!1)(t,e,r)},e}(y),j=new N,_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Mixed engineering"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,r){return t.exponent<33?j.formatDecimal(t,e,r):h(d,this.formatExponent.bind(this),10,3,!1)(t,e,r)},e}(y),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Logarithm"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,r){var n=t.log10();return"e".concat(this.formatExponent(n,e,(function(t,e){return t.toFixed(e)}),r))},e}(y),S=new g,A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Mixed Logarithm (Sci)"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e,r){if(t.exponent<33)return S.formatDecimal(t,e,r);var n=t.log10();return"e".concat(this.formatExponent(n,e,(function(t,e){return t.toFixed(e)}),r))},e}(y),F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Brackets"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t){for(var e=[")","[","{","]","(","}"],r=Math.LN10/Math.log(6)*t.log10(),n=Math.floor(r),o=r-n,i=Math.floor(36*o),a="";n>=6;){var u=n%6;n-=u,n/=6,a=e[u]+a}return a="e".concat(e[n]).concat(a,"."),a+=e[Math.floor(i/6)],a+=e[i%6]},e}(y),U=Math.log10(Number.MAX_VALUE),L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Infinity"},enumerable:!1,configurable:!0}),e.prototype.formatDecimal=function(t,e){var r=t.log10()/U,n=r<1e3?4:3,o=r.toFixed(Math.max(n,e));return i.exponentCommas.show?"".concat(u(o),"∞"):"".concat(o,"∞")},e}(y),E=[[1e6,"M̄"],[9e5,"C̄M̄"],[5e5,"D̄"],[4e5,"C̄D̄"],[1e5,"C̄"],[9e4,"X̄C̄"],[5e4,"L̄"],[4e4,"X̄L̄"],[1e4,"X̄"],[9e3,"ⅯX̄"],[5e3,"V̄"],[4e3,"ⅯV̄"],[1e3,"Ⅿ"],[900,"ⅭⅯ"],[500,"Ⅾ"],[400,"ⅭⅮ"],[100,"Ⅽ"],[90,"ⅩⅭ"],[50,"Ⅼ"],[40,"ⅩⅬ"],[10,"Ⅹ"],[9,"ⅠⅩ"],[5,"Ⅴ"],[4,"ⅠⅤ"],[1,"Ⅰ"]],I=["","·",":","∴","∷","⁙"],C=Math.log10(4e6),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Roman"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"Infinitus"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.romanize(t)},e.prototype.formatDecimal=function(t){if(t.lt(4e6))return this.romanize(t.toNumber());var e=t.log10()/C,r=Math.pow(4e6,e-Math.floor(e));return"".concat(this.romanize(r),"↑").concat(this.formatDecimal(new o.default(e)))},e.prototype.romanize=function(t){for(var e="",r=0,n=E;r5&&(u-=6,e+="S"),e+=I[u])},e}(y),k="⠀⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿⡀⡁⡂⡃⡄⡅⡆⡇⡈⡉⡊⡋⡌⡍⡎⡏⡐⡑⡒⡓⡔⡕⡖⡗⡘⡙⡚⡛⡜⡝⡞⡟⡠⡡⡢⡣⡤⡥⡦⡧⡨⡩⡪⡫⡬⡭⡮⡯⡰⡱⡲⡳⡴⡵⡶⡷⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⢈⢉⢊⢋⢌⢍⢎⢏⢐⢑⢒⢓⢔⢕⢖⢗⢘⢙⢚⢛⢜⢝⢞⢟⢠⢡⢢⢣⢤⢥⢦⢧⢨⢩⢪⢫⢬⢭⢮⢯⢰⢱⢲⢳⢴⢵⢶⢷⢸⢹⢺⢻⢼⢽⢾⢿⣀⣁⣂⣃⣄⣅⣆⣇⣈⣉⣊⣋⣌⣍⣎⣏⣐⣑⣒⣓⣔⣕⣖⣗⣘⣙⣚⣛⣜⣝⣞⣟⣠⣡⣢⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾⣿",B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Dots"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"⣿⠀⣿"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.dotify(254*t)},e.prototype.formatDecimal=function(t){if(t.lt(16387063.9980315))return this.dotify(254*t.toNumber());var e=t.log(254),r=Math.floor(e-2),n=Math.pow(254,e-r);return"".concat(this.dotify(r),"⣿").concat(this.dotify(254*n))},e.prototype.dotify=function(t,e){void 0===e&&(e=!1);var r=Math.round(t);return!e&&r<254?k[r+1]:r<64516?k[Math.floor(r/254)+1]+k[r%254+1]:this.dotify(Math.floor(r/64516))+this.dotify(r%64516,!0)},e}(y),T=["̍","̶","͓","̿","҉","̰","̚","̸","͚","̷"],Q=["H","E"," ","C","O","M","E","S"];for(var q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Zalgo"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return Q.map((function(t){return t+(e=T)[Math.floor(Math.random()*e.length)];var e})).join("")},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.heComes(new o.default(t))},e.prototype.formatDecimal=function(t){return this.heComes(t)},e.prototype.heComes=function(t){for(var e=t.plus(1).log10()/66666*1e3,r=Number(e.toFixed(2)),n=Math.floor(Math.abs(Math.pow(2,30)*(e-r))),o=Array.from(u(r)),i=Array.from(n.toString()+e.toFixed(0)),a=0;a0||0===r&&a%2==1)&&(a+=1),a},e}(y),G=[[0,"pL",0],[61611520,"minim",0],[3696691200,"dram",1],[29573529600,"ounce",2],[118294118400,"gill",2],[236588236800,"cup",3],[473176473600,"pint",4],[946352947200,"quart",4],[3785411788800,"gallon",4],[0xf7e1e900000,"pin",3],[34068706099200,"firkin",3],[68137412198400,"kilderkin",4],[0x7bf0f4800000,"barrel",4],[0xb9e96ec00000,"hogshead",5],[0xf7e1e9000000,"puncheon",6],[408824473190400,"butt",7],[817648946380800,"tun",7]],H=G[1],R=["minute ","tiny ","petite ","small ","modest ","medium ","generous ","large ","great ","grand ","huge ","gigantic ","immense ","colossal ","vast ","galactic ","cosmic ","infinite ","eternal "],$=new Set("aeiouAEIOU"),K=10*G[G.length-1][0],W=Math.log10(K),J=Math.log10(K/H[0]),Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Imperial"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.formatDecimal(new o.default(t))},e.prototype.formatDecimal=function(t){if(t.lt(K))return this.convertToVolume(t.toNumber(),R[0]);for(var e=t.log10()-W,r=1;e>J;)r++,e/=J;return this.convertToVolume(Math.pow(10,e)*H[0],R[r])},e.prototype.convertToVolume=function(t,e){var r=this.findVolumeUnit(t);if(0===r)return this.formatMetric(t);var n=this.checkSmallUnits(e,t,r);if(void 0!==n)return n;var o=G[r],i=Math.floor(t/o[0]),a=t-i*o[0];if(r0&&s>r-o[2];--s){var m=G[s],h=Math.floor(a/m[0]);if(h>9&&1!==s)break;var d=a-h*m[0];d<.99*p&&(c=h,l=s,p=d)}return this.bigAndSmall(e,i,o,c,G[l])},e.prototype.formatMetric=function(t){return t<1e3?"".concat(t<10||t===Math.round(t)?t.toFixed(2):t.toFixed(0),"pL"):t<1e6?"".concat((t/1e3).toPrecision(4),"nL"):"".concat((t/1e6).toPrecision(4),"μL")},e.prototype.checkSmallUnits=function(t,e,r){var n=G[r];if(r<=3&&e+9.5*H[0]>G[r+1][0])return this.almostOrShortOf(e,t,1,G[r+1],H);if(1===r){var o=Math.round(10*e/n[0]);return 10===o?this.addArticle(t+n[1]):"".concat((o/10).toFixed(o<100?1:0)," ").concat(t).concat(n[1],"s")}if(2===r){var i=Math.floor(e/n[0]),a=e-i*n[0];if(a>50.5*H[0])return this.almostOrShortOf(e,t,i+1,n,H);var u=Math.round(a/H[0]);return this.bigAndSmall(t,i,n,u,H)}},e.prototype.findVolumeUnit=function(t){for(var e=0,r=G.length,n=0;r-e>1;)n=Math.floor((e+r)/2),G[n][0]>t?r=n:e=n;return e},e.prototype.checkAlmost=function(t,e,r,n){var o=G[n];if(e+G[n-o[2]][0]>=o[0])return this.almost(t,r+1,o);var i=G[n+1-o[2]];return e+i[0]>=o[0]?this.shortOf(t,r+1,o,1,i):void 0},e.prototype.bigAndSmall=function(t,e,r,n,o){var i=this.pluralOrArticle(e,t+r[1]);return 0===n?i:"".concat(i," and ").concat(this.pluralOrArticle(n,o[1]))},e.prototype.almost=function(t,e,r){return"almost ".concat(this.pluralOrArticle(e,t+r[1]))},e.prototype.almostOrShortOf=function(t,e,r,n,o){var i=Math.round((r*n[0]-t)/o[0]);return 0===i?this.almost(e,r,n):this.shortOf(e,r,n,i,o)},e.prototype.shortOf=function(t,e,r,n,o){return"".concat(this.pluralOrArticle(n,o[1])," short of ").concat(this.pluralOrArticle(e,t+r[1]))},e.prototype.pluralOrArticle=function(t,e){return 1===t?this.addArticle(e):"".concat(t," ").concat(e,"s")},e.prototype.addArticle=function(t){return($.has(t[0])?"an ":"a ")+t},e}(y),tt=["🕛","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚"],et=Math.log10(12),rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"Clock"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"infinite",{get:function(){return"🕛🕡"},enumerable:!1,configurable:!0}),e.prototype.formatUnder1000=function(t){return this.clockwise(new o.default(t))},e.prototype.formatDecimal=function(t){return this.clockwise(t)},e.prototype.clockwise=function(t){if(t.lt(12))return this.hour(t.toNumber());var e=t.log10()/et,r=Math.floor(e);if(e<301){var n=(Math.pow(12,e-r+1)-12)/11;if(r<13)return this.hour(r-1)+this.hour(n);var o="";return(r-=13)>=144&&(o=this.hour(0),r-=144),o+this.hour(r/12)+this.hour(r%12)+this.hour(n)}r-=301;for(var i=1;r>=1728;)r=(r-1728)/12,++i;return this.hour(i)+this.hour(r/144)+this.hour(r%144/12)+this.hour(r%12)},e.prototype.hour=function(t){return tt[Math.max(Math.min(Math.floor(t),11),0)]},e}(y),nt=new o.default(10006),ot=Math.log10(10006),it=[],at=new Array(10006).fill(!1),ut=Math.ceil(Math.sqrt(10006)),ft=2;ft0&&(n>1?e.push("".concat(r).concat(mt[n])):e.push(r)),r=t[o],n=1),o===t.length-1&&(n>1?e.push("".concat(t[o]).concat(mt[n])):e.push(t[o]));return e.join("×")},e.prototype.findGreatestLtePrimeIndex=function(t){if(t>=st)return pt;for(var e=0,r=pt;r!==e+1;){var n=Math.floor((r+e)/2),o=it[n];if(o===t)return n;t=8;){var u=r%8;r=(r-u)/8,a.push(dt[u])}return a.push(dt[r]),a.join("")},e.prototype.flipBars=function(t){for(var e=[],r=0,n=t;r0||0===i.length;)i.push(e[o%t]),o=Math.floor(o/t);var a=i.reverse().join("");return n>0&&(a=a.padStart(n+1,"0"),a="".concat(a.slice(0,-n),".").concat(a.slice(-n))),a}},t.formatMantissaBaseTen=d,t.formatMantissaWithExponent=h,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/docs/index.js b/docs/index.js index 2468407..4566c88 100644 --- a/docs/index.js +++ b/docs/index.js @@ -76,6 +76,7 @@ const displays = (function() { N.MixedScientificNotation, N.MixedEngineeringNotation, N.LogarithmNotation, + N.MixedLogarithmSciNotation, N.BracketsNotation, N.InfinityNotation, N.RomanNotation, @@ -97,7 +98,6 @@ const displays = (function() { CN.OmegaShortNotation, CN.PrecisePrimeNotation, CN.JapaneseNotation, - CN.MixedLogarithmSciNotation, CN.TritetratedNotation, CN.FlagsNotation, CN.YesNoNotation, diff --git a/src/community/index.ts b/src/community/index.ts index 6923be2..e442858 100644 --- a/src/community/index.ts +++ b/src/community/index.ts @@ -5,7 +5,6 @@ export * from "./omega"; export * from "./omega-short"; export * from "./precise-prime"; export * from "./japanese"; -export * from "./mixed-logarithm-sci"; export * from "./tritetrated"; export * from "./flags"; export * from "./yes-no"; diff --git a/src/index.ts b/src/index.ts index c60cee1..bfc5637 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,7 @@ export * from "./standard"; export * from "./mixed-scientific"; export * from "./mixed-engineering"; export * from "./logarithm"; +export * from "./mixed-logarithm-sci"; export * from "./brackets"; export * from "./infinity"; export * from "./roman"; diff --git a/src/community/mixed-logarithm-sci.ts b/src/mixed-logarithm-sci.ts similarity index 85% rename from src/community/mixed-logarithm-sci.ts rename to src/mixed-logarithm-sci.ts index c9a664e..d2fd01a 100644 --- a/src/community/mixed-logarithm-sci.ts +++ b/src/mixed-logarithm-sci.ts @@ -1,6 +1,6 @@ import Decimal from "break_infinity.js"; -import { Notation } from "../notation"; -import { ScientificNotation } from "../scientific"; +import { Notation } from "./notation"; +import { ScientificNotation } from "./scientific"; const scientific = new ScientificNotation();