1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-30 20:02:07 +00:00
The-Modding-Tree/js/break_eternity.min.js

2 lines
30 KiB
JavaScript
Raw Normal View History

2020-08-19 02:50:24 +00:00
"use strict";function _instanceof(t,r){return null!=r&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](t):t instanceof r}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,r){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t=t||self).Decimal=r()}(void 0,function(){var t=Math.log10(9e15),r=function(){for(var t=[],r=-323;r<=308;r++)t.push(Number("1e"+r));return function(r){return t[r+323]}}(),i=function(t){return h.fromValue_noAlloc(t)},e=function(t,r,i){return h.fromComponents(t,r,i)},n=function(t,r,i){return h.fromComponents_noNormalize(t,r,i)},a=function(t,r){var i=r+1,e=Math.ceil(Math.log10(Math.abs(t))),n=Math.round(t*Math.pow(10,i-e))*Math.pow(10,e-i);return parseFloat(n.toFixed(Math.max(i-e,0)))},s=function(t){return Math.sign(t)*Math.log10(Math.abs(t))},o=function(t){var r,i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-10;if(!Number.isFinite(t))return t;if(0===t)return t;if(1===t)return.5671432904097838;r=t<10?0:Math.log(t)-Math.log(Math.log(t));for(var n=0;n<100;++n){if(i=(t*Math.exp(-r)+r*r)/(r+1),Math.abs(i-r)<e*Math.abs(i))return i;r=i}throw Error("Iteration failed to converge: "+t)},h=function(){function h(t){this.sign=Number.NaN,this.layer=Number.NaN,this.mag=Number.NaN,_instanceof(t,h)?this.fromDecimal(t):"number"==typeof t?this.fromNumber(t):"string"==typeof t?this.fromString(t):(this.sign=0,this.layer=0,this.mag=0)}Object.defineProperty(h.prototype,"m",{get:function(){if(0===this.sign)return 0;if(0===this.layer){var t,i=Math.floor(Math.log10(this.mag));return t=5e-324===this.mag?5:this.mag/r(i),this.sign*t}if(1===this.layer){var e=this.mag-Math.floor(this.mag);return this.sign*Math.pow(10,e)}return this.sign},set:function(t){this.layer<=2?this.fromMantissaExponent(t,this.e):(this.sign=Math.sign(t),0===this.sign&&(this.layer,this.exponent))},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"e",{get:function(){return 0===this.sign?0:0===this.layer?Math.floor(Math.log10(this.mag)):1===this.layer?Math.floor(this.mag):2===this.layer?Math.floor(Math.sign(this.mag)*Math.pow(10,Math.abs(this.mag))):this.mag*Number.POSITIVE_INFINITY},set:function(t){this.fromMantissaExponent(this.m,t)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"s",{get:function(){return this.sign},set:function(t){0===t?(this.sign=0,this.layer=0,this.mag=0):this.sign=t},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"mantissa",{get:function(){return this.m},set:function(t){this.m=t},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"exponent",{get:function(){return this.e},set:function(t){this.e=t},enumerable:!0,configurable:!0}),h.fromComponents=function(t,r,i){return(new h).fromComponents(t,r,i)},h.fromComponents_noNormalize=function(t,r,i){return(new h).fromComponents_noNormalize(t,r,i)},h.fromMantissaExponent=function(t,r){return(new h).fromMantissaExponent(t,r)},h.fromMantissaExponent_noNormalize=function(t,r){return(new h).fromMantissaExponent_noNormalize(t,r)},h.fromDecimal=function(t){return(new h).fromDecimal(t)},h.fromNumber=function(t){return(new h).fromNumber(t)},h.fromString=function(t){return(new h).fromString(t)},h.fromValue=function(t){return(new h).fromValue(t)},h.fromValue_noAlloc=function(t){return _instanceof(t,h)?t:new h(t)},h.abs=function(t){return i(t).abs()},h.neg=function(t){return i(t).neg()},h.negate=function(t){return i(t).neg()},h.negated=function(t){return i(t).neg()},h.sign=function(t){return i(t).sign()},h.sgn=function(t){return i(t).sign()},h.round=function(t){return i(t).round()},h.floor=function(t){return i(t).floor()},h.ceil=function(t){return i(t).ceil()},h.trunc=function(t){return i(t).trunc()},h.add=function(t,r){return i(t).add(r)},h.plus=function(t,r){return i(t).add(r)},h.sub=fu