"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{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;