UNPKG

archi

Version:

Easy math with decimals for Javascript

1 lines 2.7 kB
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){(function(c,d){"use strict";function e(a,b){return Math.max(g(a),g(b))}function f(a){var b=a.toString(),c=b.indexOf("."),d=-1===c?0:b.length-b.indexOf(".")-1;return d}function g(a){var b=f(a),c=Math.pow(10,b);return c}var h=a("poser")("Number");h.prototype.plus=function(a){var b=+this,c=+a,d=e(b,c);return new h((b*d+c*d)/d)},h.prototype.minus=function(a){var b=+this,c=+a,d=e(b,c);return new h((b*d-c*d)/d)},h.prototype.mod=function(a){var b=+this,c=+a,d=e(b,c);return new h(b*d%(c*d))};var i={calc:function(a){return new h(a)}};c.browser&&(d.archi=i),b.exports=i}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:2,poser:3}],2:[function(a,b,c){function d(){k=!1,h.length?j=h.concat(j):l=-1,j.length&&e()}function e(){if(!k){var a=setTimeout(d);k=!0;for(var b=j.length;b;){for(h=j,j=[];++l<b;)h[l].run();l=-1,b=j.length}h=null,k=!1,clearTimeout(a)}}function f(a,b){this.fun=a,this.array=b}function g(){}var h,i=b.exports={},j=[],k=!1,l=-1;i.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];j.push(new f(a,b)),1!==j.length||k||setTimeout(e,0)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.binding=function(a){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(a){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],3:[function(a,b,c){function d(a){e[a]=function(){return e(a)}}var e=a("./src/node");b.exports=e,["Array","Function","Object","Date","String"].forEach(d)},{"./src/node":4}],4:[function(a,b,c){(function(a){"use strict";function c(a){var b=e.createElement("iframe");return b.style.display="none",e.body.appendChild(b),d(a,b.contentWindow)}function d(a,b){var c,d=window[a].prototype,e=b[a];for(c in d)e.prototype[c]=d[c];return e}var e=a.document;b.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]);