"use strict";function h(t,n=15){return+parseFloat(Number(t).toPrecision(n))}function u(t){const n=t.toString().split(/[eE]/),e=(n[0].split(".")[1]||"").length-+(n[1]||0);return e>0?e:0}function s(t){if(t.toString().indexOf("e")===-1)return Number(t.toString().replace(".",""));const n=u(t);return n>0?h(Number(t)*Math.pow(10,n)):Number(t)}function f(t){(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&console.warn(`${t} \u8D85\u51FA\u4E86\u7CBE\u5EA6\u9650\u5236\uFF0C\u7ED3\u679C\u53EF\u80FD\u4E0D\u6B63\u786E`)}function l(t,n){const[e,r,...o]=t;let i=n(e,r);return o.forEach(c=>{i=n(i,c)}),i}function a(...t){if(t.length>2)return l(t,a);const[n,e]=t,r=s(n),o=s(e),i=u(n)+u(e),c=r*o;return f(c),c/Math.pow(10,i)}function d(...t){if(t.length>2)return l(t,d);const[n,e]=t,r=s(n),o=s(e);return f(r),f(o),a(r/o,h(Math.pow(10,u(e)-u(n))))}function g(t,n){const e=Math.pow(10,n);let r=d(Math.round(Math.abs(a(t,e))),e);return t<0&&r!==0&&(r=a(r,-1)),r}exports.round=g;
