diff --git a/dist/esm/big-decimal.d.ts b/dist/esm/big-decimal.d.ts index 556d018..40c9c75 100644 --- a/dist/esm/big-decimal.d.ts +++ b/dist/esm/big-decimal.d.ts @@ -23,7 +23,7 @@ declare class bigDecimal { static multiply(number1: any, number2: any): string; multiply(number: bigDecimal): bigDecimal; static divide(number1: any, number2: any, precision?: number): string; - divide(number: bigDecimal, precision: any): bigDecimal; + divide(number: bigDecimal, precision?: number): bigDecimal; static modulus(number1: any, number2: any): string; modulus(number: bigDecimal): bigDecimal; static compareTo(number1: any, number2: any): 0 | 1 | -1; diff --git a/dist/esm/big-decimal.js.map b/dist/esm/big-decimal.js.map index 6d42104..5512b42 100644 --- a/dist/esm/big-decimal.js.map +++ b/dist/esm/big-decimal.js.map @@ -1 +1 @@ -{"version":3,"file":"big-decimal.js","sources":["../../../src/add.ts","../../../src/abs.ts","../../../src/roundingModes.ts","../../../src/round.ts","../../../src/multiply.ts","../../../src/divide.ts","../../../src/subtract.ts","../../../src/modulus.ts","../../../src/compareTo.ts","../../../src/big-decimal.ts"],"sourcesContent":["//function add {\nexport function add(number1: string, number2 = \"0\") {\n let neg = 0,\n ind = -1,\n neg_len;\n\n //check for negatives\n if (number1[0] == \"-\") {\n number1 = number1.substring(1);\n if (!testZero(number1)) {\n neg++;\n ind = 1;\n neg_len = number1.length;\n }\n }\n if (number2[0] == \"-\") {\n number2 = number2.substring(1);\n if (!testZero(number2)) {\n neg++;\n ind = 2;\n neg_len = number2.length;\n }\n }\n\n number1 = trim(number1);\n number2 = trim(number2);\n\n [number1, number2] = pad(trim(number1), trim(number2));\n\n if (neg == 1) {\n if (ind === 1) number1 = compliment(number1);\n else if (ind === 2) number2 = compliment(number2);\n }\n\n let res = addCore(number1, number2);\n if (!neg) return trim(res);\n else if (neg == 2) return \"-\" + trim(res);\n else {\n if (number1.length < res.length) return trim(res.substring(1));\n else return \"-\" + trim(compliment(res));\n }\n}\n\nfunction compliment(number: string) {\n if (testZero(number)) {\n return number;\n }\n\n let s = \"\",\n l = number.length,\n dec = number.split(\".\")[1],\n ld = dec ? dec.length : 0;\n\n for (let i = 0; i < l; i++) {\n if (number[i] >= \"0\" && number[i] <= \"9\") s += 9 - parseInt(number[i]);\n else s += number[i];\n }\n\n let one = ld > 0 ? \"0.\" + new Array(ld).join(\"0\") + \"1\" : \"1\";\n\n return addCore(s, one);\n}\n\nexport function trim(number: string) {\n let parts = number.split(\".\");\n\n if (!parts[0]) parts[0] = \"0\";\n\n while (parts[0][0] == \"0\" && parts[0].length > 1)\n parts[0] = parts[0].substring(1);\n\n return parts[0] + (parts[1] ? \".\" + parts[1] : \"\");\n}\n\nexport function pad(number1: string, number2: string) {\n let parts1 = number1.split(\".\"),\n parts2 = number2.split(\".\");\n\n //pad integral part\n let length1 = parts1[0].length,\n length2 = parts2[0].length;\n if (length1 > length2) {\n parts2[0] =\n new Array(Math.abs(length1 - length2) + 1).join(\"0\") +\n (parts2[0] ? parts2[0] : \"\");\n } else {\n parts1[0] =\n new Array(Math.abs(length1 - length2) + 1).join(\"0\") +\n (parts1[0] ? parts1[0] : \"\");\n }\n\n //pad fractional part\n (length1 = parts1[1] ? parts1[1].length : 0),\n (length2 = parts2[1] ? parts2[1].length : 0);\n if (length1 || length2) {\n if (length1 > length2) {\n parts2[1] =\n (parts2[1] ? parts2[1] : \"\") +\n new Array(Math.abs(length1 - length2) + 1).join(\"0\");\n } else {\n parts1[1] =\n (parts1[1] ? parts1[1] : \"\") +\n new Array(Math.abs(length1 - length2) + 1).join(\"0\");\n }\n }\n\n number1 = parts1[0] + (parts1[1] ? \".\" + parts1[1] : \"\");\n number2 = parts2[0] + (parts2[1] ? \".\" + parts2[1] : \"\");\n\n return [number1, number2];\n}\n\nfunction addCore(number1: string, number2: string) {\n [number1, number2] = pad(number1, number2);\n\n let sum = \"\",\n carry = 0;\n\n for (let i = number1.length - 1; i >= 0; i--) {\n if (number1[i] === \".\") {\n sum = \".\" + sum;\n continue;\n }\n let temp = parseInt(number1[i]) + parseInt(number2[i]) + carry;\n sum = (temp % 10) + sum;\n carry = Math.floor(temp / 10);\n }\n\n return carry ? carry.toString() + sum : sum;\n}\n\nfunction testZero(number: string) {\n return /^0[0]*[.]{0,1}[0]*$/.test(number);\n}\n","export function abs(n: number | string | bigint) {\n if (typeof n == \"number\" || typeof n == \"bigint\") n = n.toString();\n if (n[0] == \"-\") return n.substring(1);\n return n;\n}\n","export enum RoundingModes {\n /**\n * Rounding mode to round towards positive infinity.\n */\n CEILING,\n\n /**\n * Rounding mode to round towards zero.\n */\n DOWN,\n\n /**\n * Rounding mode to round towards negative infinity.\n */\n FLOOR,\n\n /**\n * Rounding mode to round towards \"nearest neighbor\" unless both neighbors are equidistant, \n * in which case round down.\n */\n HALF_DOWN,\n\n /**\n * Rounding mode to round towards the \"nearest neighbor\" unless both neighbors are equidistant, \n * in which case, round towards the even neighbor.\n */\n HALF_EVEN,\n\n /**\n * Rounding mode to round towards \"nearest neighbor\" unless both neighbors are equidistant, \n * in which case round up.\n */\n HALF_UP,\n\n /**\n * Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary.\n * UNIMPLEMENTED\n */\n UNNECESSARY,\n\n /**\n * Rounding mode to round away from zero.\n */\n UP\n}\n\n","import { RoundingModes } from './roundingModes';\n/**\n * \n * @param input the number to round\n * @param n precision\n * @param mode Rounding Mode\n */\nexport function roundOff(input: number | string | bigint, n: number = 0, mode=RoundingModes.HALF_EVEN) {\n if (mode === RoundingModes.UNNECESSARY) {\n throw new Error(\"UNNECESSARY Rounding Mode has not yet been implemented\");\n }\n\n if (typeof (input) == 'number' || typeof (input) == 'bigint')\n input = input.toString();\n\n let neg = false;\n if (input[0] === '-') {\n neg = true;\n input = input.substring(1);\n }\n\n let parts = input.split('.'),\n partInt = parts[0],\n partDec = parts[1];\n\n //handle case of -ve n: roundOff(12564,-2)=12600\n if (n < 0) {\n n = -n;\n if (partInt.length <= n)\n return '0';\n else {\n let prefix = partInt.substr(0, partInt.length - n);\n input = prefix + '.' + partInt.substr(partInt.length - n) + partDec;\n prefix = roundOff(input, 0, mode);\n return (neg ? '-' : '') + prefix + (new Array(n + 1).join('0'));\n }\n }\n\n\n // handle case when integer output is desired\n if (n == 0) {\n let l = partInt.length;\n if (greaterThanFive(parts[1], partInt, neg, mode)) {\n partInt = increment(partInt);\n }\n return (neg&&parseInt(partInt) ? '-' : '') + partInt;\n }\n\n\n // handle case when n>0\n if (!parts[1]) {\n return (neg ? '-' : '') + partInt + '.' + (new Array(n + 1).join('0'));\n } else if (parts[1].length < n) {\n return (neg ? '-' : '') + partInt + '.' + parts[1] + (new Array(n - parts[1].length + 1).join('0'));\n }\n\n partDec = parts[1].substring(0, n);\n let rem = parts[1].substring(n);\n\n if (rem && greaterThanFive(rem, partDec, neg, mode)) {\n partDec = increment(partDec);\n if (partDec.length > n) {\n return (neg ? '-' : '') + increment(partInt, parseInt(partDec[0])) + '.' + partDec.substring(1);\n }\n }\n return (neg&&(parseInt(partInt) || parseInt(partDec)) ? '-' : '') + partInt + '.' + partDec;\n}\n\nfunction greaterThanFive(part: string, pre: string, neg: boolean, mode: RoundingModes) {\n if (!part || part === new Array(part.length + 1).join('0'))\n return false;\n\n // #region UP, DOWN, CEILING, FLOOR \n if (mode === RoundingModes.DOWN || (!neg && mode === RoundingModes.FLOOR) ||\n (neg && mode === RoundingModes.CEILING))\n return false;\n\n if (mode === RoundingModes.UP || (neg && mode === RoundingModes.FLOOR) ||\n (!neg && mode === RoundingModes.CEILING))\n return true;\n // #endregion\n\n // case when part !== five\n let five = '5' + (new Array(part.length).join('0'));\n if (part > five)\n return true;\n else if (part < five)\n return false;\n\n // case when part === five\n switch (mode) {\n case RoundingModes.HALF_DOWN: return false;\n case RoundingModes.HALF_UP: return true;\n case RoundingModes.HALF_EVEN:\n default: return (parseInt(pre[pre.length - 1]) % 2 == 1)\n }\n}\n\nfunction increment(part, c: number = 0) {\n if (!c)\n c = 1;\n if (typeof (part) == 'number')\n part.toString();\n\n let l = part.length - 1,\n s = '';\n\n for (let i = l; i >= 0; i--) {\n let x = parseInt(part[i]) + c;\n if (x == 10) {\n c = 1; x = 0;\n } else {\n c = 0;\n }\n s += x;\n }\n if (c)\n s += c;\n\n return s.split('').reverse().join('');\n}","export function multiply(number1, number2) {\n\tnumber1 = number1.toString();\n\tnumber2 = number2.toString();\n\n\t/*Filter numbers*/\n\tlet negative = 0;\n\tif (number1[0] == '-') {\n\t\tnegative++;\n\t\tnumber1 = number1.substr(1);\n\t}\n\tif (number2[0] == '-') {\n\t\tnegative++;\n\t\tnumber2 = number2.substr(1);\n\t}\n\tnumber1 = trailZero(number1);\n\tnumber2 = trailZero(number2);\n\tlet decimalLength1 = 0;\n\tlet decimalLength2 = 0;\n\n\tif (number1.indexOf('.') != -1) {\n\t\tdecimalLength1 = number1.length - number1.indexOf('.') - 1;\n\t}\n\n\tif (number2.indexOf('.') != -1) {\n\t\tdecimalLength2 = number2.length - number2.indexOf('.') - 1;\n\t}\n\tlet decimalLength = decimalLength1 + decimalLength2;\n\tnumber1 = trailZero(number1.replace('.', ''));\n\tnumber2 = trailZero(number2.replace('.', ''));\n\n\tif (number1.length < number2.length) {\n\t\tlet temp = number1;\n\t\tnumber1 = number2;\n\t\tnumber2 = temp;\n\t}\n\n\tif (number2 == '0') {\n\t\treturn '0';\n\t}\n\n\t/*\n\t* Core multiplication\n\t*/\n\tlet length = number2.length;\n\tlet carry = 0;\n\tlet positionVector = [];\n\tlet currentPosition = length - 1;\n\n\tlet result = \"\";\n\tfor (let i = 0; i < length; i++) {\n\t\tpositionVector[i] = number1.length - 1;\n\t}\n\tfor (let i = 0; i < 2 * number1.length; i++) {\n\t\tlet sum = 0;\n\t\tfor (let j = number2.length - 1; j >= currentPosition && j >= 0; j--) {\n\t\t\tif (positionVector[j] > -1 && positionVector[j] < number1.length) {\n\t\t\t\tsum += parseInt(number1[positionVector[j]--]) * parseInt(number2[j]);\n\t\t\t}\n\t\t}\n\t\tsum += carry;\n\t\tcarry = Math.floor(sum / 10);\n\t\tresult = sum % 10 + result;\n\t\tcurrentPosition--;\n\t}\n\t/*\n\t* Formatting result\n\t*/\n\tresult = trailZero(adjustDecimal(result, decimalLength));\n\tif (negative == 1) {\n\t\tresult = '-' + result;\n\t}\n\treturn result;\n}\n\n/*\n* Add decimal point\n*/\nfunction adjustDecimal(number, decimal) {\n\tif (decimal == 0)\n\t\treturn number;\n\telse {\n\t\tnumber = (decimal >= number.length) ? ((new Array(decimal - number.length + 1)).join('0') + number) : number;\n\t\treturn number.substr(0, number.length - decimal) + '.' + number.substr(number.length - decimal, decimal)\n\t}\n}\n\n/*\n* Removes zero from front and back*/\nfunction trailZero(number) {\n\twhile (number[0] == '0') {\n\t\tnumber = number.substr(1);\n\t}\n\tif (number.indexOf('.') != -1) {\n\t\twhile (number[number.length - 1] == '0') {\n\t\t\tnumber = number.substr(0, number.length - 1);\n\t\t}\n\t}\n\tif (number == \"\" || number == \".\") {\n\t\tnumber = '0';\n\t} else if (number[number.length - 1] == '.') {\n\t\tnumber = number.substr(0, number.length - 1);\n\t}\n\tif (number[0] == '.') {\n\t\tnumber = '0' + number;\n\t}\n\treturn number;\n}","import { add, trim } from './add';\nimport { roundOff } from './round';\n\nexport function divide(dividend, divisor, precission = 8) {\n if (divisor == 0) {\n throw new Error('Cannot divide by 0');\n }\n\n dividend = dividend.toString();\n divisor = divisor.toString();\n\n // remove trailing zeros in decimal ISSUE#18\n dividend = dividend.replace(/(\\.\\d*?[1-9])0+$/g, \"$1\").replace(/\\.0+$/, \"\");\n divisor = divisor.replace(/(\\.\\d*?[1-9])0+$/g, \"$1\").replace(/\\.0+$/, \"\");\n\n if (dividend == 0)\n return '0';\n\n let neg = 0;\n if (divisor[0] == '-') {\n divisor = divisor.substring(1);\n neg++;\n }\n if (dividend[0] == '-') {\n dividend = dividend.substring(1);\n neg++;\n }\n\n var pt_dvsr = divisor.indexOf('.') > 0 ? divisor.length - divisor.indexOf('.') - 1 : -1;\n\n divisor = trim(divisor.replace('.', ''));\n if (pt_dvsr >= 0) {\n let pt_dvnd = dividend.indexOf('.') > 0 ? dividend.length - dividend.indexOf('.') - 1 : -1;\n\n if (pt_dvnd == -1) {\n dividend = trim(dividend + (new Array(pt_dvsr + 1)).join('0'));\n } else {\n if (pt_dvsr > pt_dvnd) {\n dividend = dividend.replace('.', '');\n dividend = trim(dividend + (new Array(pt_dvsr - pt_dvnd + 1)).join('0'));\n } else if (pt_dvsr < pt_dvnd) {\n dividend = dividend.replace('.', '');\n let loc = dividend.length - pt_dvnd + pt_dvsr;\n dividend = trim(dividend.substring(0, loc) + '.' + dividend.substring(loc));\n } else if (pt_dvsr == pt_dvnd) {\n dividend = trim(dividend.replace('.', ''));\n }\n }\n }\n\n let prec = 0, dl = divisor.length, rem = '0', quotent = '';\n let dvnd = (dividend.indexOf('.') > -1 && dividend.indexOf('.') < dl) ? dividend.substring(0, dl + 1) : dividend.substring(0, dl);\n dividend = (dividend.indexOf('.') > -1 && dividend.indexOf('.') < dl) ? dividend.substring(dl + 1) : dividend.substring(dl);\n \n if (dvnd.indexOf('.') > -1) {\n let shift = dvnd.length - dvnd.indexOf('.') - 1;\n dvnd = dvnd.replace('.', '');\n if (dl > dvnd.length) {\n shift += dl - dvnd.length;\n dvnd = dvnd + (new Array(dl - dvnd.length + 1)).join('0');\n }\n prec = shift;\n quotent = '0.' + (new Array(shift)).join('0');\n\n }\n\n precission = precission + 2;\n\n while (prec <= precission) {\n let qt = 0;\n while (parseInt(dvnd) >= parseInt(divisor)) {\n dvnd = add(dvnd, '-' + divisor);\n qt++;\n }\n quotent += qt;\n\n if (!dividend) {\n if (!prec)\n quotent += '.';\n prec++;\n dvnd = dvnd + '0';\n } else {\n if (dividend[0] == '.') {\n quotent += '.';\n prec++;\n dividend = dividend.substring(1);\n }\n dvnd = dvnd + dividend.substring(0, 1);\n dividend = dividend.substring(1);\n }\n }\n\n return ((neg == 1) ? '-' : '') + trim(roundOff(quotent, precission - 2));\n}","import { add } from './add';\r\n\r\nexport function subtract(number1, number2) {\r\n\tnumber1 = number1.toString();\r\n\tnumber2 = number2.toString();\r\n\tnumber2 = negate(number2);\r\n\treturn add(number1, number2);\r\n}\r\n\r\nexport function negate(number : string){\r\n\tif(number[0] == '-'){\r\n\t\tnumber = number.substr(1);\r\n\t}else{\r\n\t\tnumber = '-' + number;\r\n\t}\r\n\treturn number;\r\n}","import { divide } from './divide';\nimport { roundOff } from './round';\nimport { multiply } from './multiply';\nimport { subtract } from './subtract';\nimport { RoundingModes } from './roundingModes';\n\nexport function modulus(dividend: number|string, divisor:number|string) {\n if (divisor == 0) {\n throw new Error('Cannot divide by 0');\n }\n\n dividend = dividend.toString();\n divisor = divisor.toString();\n\n validate(dividend);\n validate(divisor);\n\n let sign = '';\n if(dividend[0] == '-'){\n sign = '-';\n dividend = dividend.substr(1);\n }\n if(divisor[0] == '-'){\n divisor = divisor.substr(1);\n }\n\n let result = subtract(dividend, multiply(divisor, roundOff(divide(dividend, divisor), 0, RoundingModes.FLOOR)));\n return sign+result;\n}\n\nfunction validate(oparand: string) {\n if (oparand.indexOf('.') != -1) {\n throw new Error('Modulus of non-integers not supported');\n }\n}\n","import { pad } from './add';\r\n\r\nexport function compareTo(number1 : string, number2 : string) {\r\n\tlet negative = false;\r\n\tif(number1[0] == '-' && number2[0] != \"-\"){\r\n\t\treturn -1;\r\n\t}else if(number1[0] != '-' && number2[0] == '-'){\r\n\t\treturn 1;\r\n\t}else if(number1[0] == '-' && number2[0] == '-'){\r\n\t\tnumber1 = number1.substr(1);\r\n\t\tnumber2 = number2.substr(1);\r\n\t\tnegative = true;\r\n\t}\r\n\t[number1, number2] = pad(number1, number2);\r\n\tif(number1.localeCompare(number2) == 0){\r\n\t\treturn 0;\r\n\t}\r\n\tfor(let i = 0 ; i < number1.length ; i++){\r\n\t\tif(number1[i] == number2[i]){\r\n\t\t\tcontinue;\r\n\t\t}else if(number1[i] > number2[i]){\r\n\t\t\tif(negative){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(negative){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn 0;\r\n}","import { add, trim } from \"./add\";\r\nimport { abs } from \"./abs\";\r\nimport { roundOff } from \"./round\";\r\nimport { multiply } from \"./multiply\";\r\nimport { divide } from \"./divide\";\r\nimport { modulus } from \"./modulus\";\r\nimport { compareTo } from \"./compareTo\";\r\nimport { subtract, negate } from \"./subtract\";\r\nimport { RoundingModes as Modes, RoundingModes } from \"./roundingModes\";\r\n\r\nclass bigDecimal {\r\n private value: string;\r\n static RoundingModes = Modes;\r\n\r\n private static validate(number): string {\r\n if (number) {\r\n number = number.toString();\r\n if (isNaN(number)) throw Error(\"Parameter is not a number: \" + number);\r\n\r\n if (number[0] == \"+\") number = number.substring(1);\r\n } else number = \"0\";\r\n\r\n //handle missing leading zero\r\n if (number.startsWith(\".\")) number = \"0\" + number;\r\n else if (number.startsWith(\"-.\")) number = \"-0\" + number.substr(1);\r\n\r\n //handle exponentiation\r\n if (/e/i.test(number)) {\r\n let [mantisa, exponent] = number.split(/[eE]/);\r\n mantisa = trim(mantisa);\r\n\r\n let sign = \"\";\r\n if (mantisa[0] == \"-\") {\r\n sign = \"-\";\r\n mantisa = mantisa.substring(1);\r\n }\r\n\r\n if (mantisa.indexOf(\".\") >= 0) {\r\n exponent = parseInt(exponent) + mantisa.indexOf(\".\");\r\n mantisa = mantisa.replace(\".\", \"\");\r\n } else {\r\n exponent = parseInt(exponent) + mantisa.length;\r\n }\r\n\r\n if (mantisa.length < exponent) {\r\n number =\r\n sign + mantisa + new Array(exponent - mantisa.length + 1).join(\"0\");\r\n } else if (mantisa.length >= exponent && exponent > 0) {\r\n number =\r\n sign +\r\n trim(mantisa.substring(0, exponent)) +\r\n (mantisa.length > exponent ? \".\" + mantisa.substring(exponent) : \"\");\r\n } else {\r\n number = sign + \"0.\" + new Array(-exponent + 1).join(\"0\") + mantisa;\r\n }\r\n }\r\n\r\n return number;\r\n }\r\n\r\n constructor(number: number | string | bigint = \"0\") {\r\n this.value = bigDecimal.validate(number);\r\n }\r\n\r\n getValue() {\r\n return this.value;\r\n }\r\n\r\n setValue(num: number | string | bigint) {\r\n this.value = bigDecimal.validate(num);\r\n }\r\n\r\n static getPrettyValue(number, digits = 3, separator = \",\"): string {\r\n // if (!(digits || separator)) {\r\n // digits = 3;\r\n // separator = ',';\r\n // } else if (!(digits && separator)) {\r\n // throw Error('Illegal Arguments. Should pass both digits and separator or pass none');\r\n // }\r\n number = bigDecimal.validate(number);\r\n let neg = number.charAt(0) == \"-\";\r\n if (neg) number = number.substring(1);\r\n var len = number.indexOf(\".\");\r\n len = len > 0 ? len : number.length;\r\n var temp = \"\";\r\n for (var i = len; i > 0; ) {\r\n if (i < digits) {\r\n digits = i;\r\n i = 0;\r\n } else i -= digits;\r\n\r\n temp =\r\n number.substring(i, i + digits) +\r\n (i < len - digits && i >= 0 ? separator : \"\") +\r\n temp;\r\n }\r\n return (neg ? \"-\" : \"\") + temp + number.substring(len);\r\n }\r\n getPrettyValue(digits = 3, separator = \",\") {\r\n return bigDecimal.getPrettyValue(this.value, digits, separator);\r\n }\r\n\r\n static round(number, precision = 0, mode = Modes.HALF_EVEN) {\r\n number = bigDecimal.validate(number);\r\n // console.log(number)\r\n if (isNaN(precision))\r\n throw Error(\"Precision is not a number: \" + precision);\r\n return roundOff(number, precision, mode);\r\n }\r\n\r\n round(precision = 0, mode = Modes.HALF_EVEN) {\r\n if (isNaN(precision))\r\n throw Error(\"Precision is not a number: \" + precision);\r\n\r\n return new bigDecimal(roundOff(this.value, precision, mode));\r\n }\r\n\r\n static abs(number) {\r\n number = bigDecimal.validate(number);\r\n return abs(number);\r\n }\r\n\r\n abs() {\r\n return new bigDecimal(abs(this.value));\r\n }\r\n\r\n static floor(number) {\r\n number = bigDecimal.validate(number);\r\n if (number.indexOf(\".\") === -1) return number;\r\n return bigDecimal.round(number, 0, RoundingModes.FLOOR);\r\n }\r\n\r\n floor() {\r\n if (this.value.indexOf(\".\") === -1) return new bigDecimal(this.value);\r\n return new bigDecimal(this.value).round(0, RoundingModes.FLOOR);\r\n }\r\n\r\n static ceil(number) {\r\n number = bigDecimal.validate(number);\r\n if (number.indexOf(\".\") === -1) return number;\r\n return bigDecimal.round(number, 0, RoundingModes.CEILING);\r\n }\r\n\r\n ceil() {\r\n if (this.value.indexOf(\".\") === -1) return new bigDecimal(this.value);\r\n return new bigDecimal(this.value).round(0, RoundingModes.CEILING);\r\n }\r\n\r\n static add(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return add(number1, number2);\r\n }\r\n\r\n add(number: bigDecimal) {\r\n return new bigDecimal(add(this.value, number.getValue()));\r\n }\r\n\r\n static subtract(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return subtract(number1, number2);\r\n }\r\n\r\n subtract(number: bigDecimal) {\r\n return new bigDecimal(subtract(this.value, number.getValue()));\r\n }\r\n\r\n static multiply(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return multiply(number1, number2);\r\n }\r\n\r\n multiply(number: bigDecimal) {\r\n return new bigDecimal(multiply(this.value, number.getValue()));\r\n }\r\n\r\n static divide(number1, number2, precision?: number) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return divide(number1, number2, precision);\r\n }\r\n\r\n divide(number: bigDecimal, precision) {\r\n return new bigDecimal(divide(this.value, number.getValue(), precision));\r\n }\r\n\r\n static modulus(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return modulus(number1, number2);\r\n }\r\n\r\n modulus(number: bigDecimal) {\r\n return new bigDecimal(modulus(this.value, number.getValue()));\r\n }\r\n\r\n static compareTo(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return compareTo(number1, number2);\r\n }\r\n\r\n compareTo(number: bigDecimal) {\r\n return compareTo(this.value, number.getValue());\r\n }\r\n\r\n static negate(number) {\r\n number = bigDecimal.validate(number);\r\n return negate(number);\r\n }\r\n\r\n negate() {\r\n return new bigDecimal(negate(this.value));\r\n }\r\n}\r\nexport default bigDecimal;\r\n"],"names":["Modes"],"mappings":"AAAA;AACgB,SAAA,GAAG,CAAC,OAAe,EAAE,OAAa,EAAA;;AAAb,IAAA,IAAA,OAAA,KAAA,KAAA,CAAA,EAAA,EAAA,OAAa,GAAA,GAAA,CAAA,EAAA;IAC5C,IAAA,GAAG,GAAG,CAAC,CACT,CAAA,GAAG,GAAG,CAAC,CAAC,CACA;;AAGV,IAAA,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;AACrB,QAAA,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC/B,QAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AACtB,YAAA,GAAG,EAAE,CAAC;YACN,GAAG,GAAG,CAAC,CAAC;AACR,YAAU,OAAO,CAAC,MAAM,CAAC;AAC1B,SAAA;AACF,KAAA;AACD,IAAA,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;AACrB,QAAA,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC/B,QAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AACtB,YAAA,GAAG,EAAE,CAAC;YACN,GAAG,GAAG,CAAC,CAAC;AACR,YAAU,OAAO,CAAC,MAAM,CAAC;AAC1B,SAAA;AACF,KAAA;AAED,IAAA,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AACxB,IAAA,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAExB,IAAA,EAAA,GAAqB,GAAG,CAAC,IAAI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C;;;;"} \ No newline at end of file +{"version":3,"file":"big-decimal.js","sources":["../../../src/add.ts","../../../src/abs.ts","../../../src/roundingModes.ts","../../../src/round.ts","../../../src/multiply.ts","../../../src/divide.ts","../../../src/subtract.ts","../../../src/modulus.ts","../../../src/compareTo.ts","../../../src/big-decimal.ts"],"sourcesContent":["//function add {\nexport function add(number1: string, number2 = \"0\") {\n let neg = 0,\n ind = -1,\n neg_len;\n\n //check for negatives\n if (number1[0] == \"-\") {\n number1 = number1.substring(1);\n if (!testZero(number1)) {\n neg++;\n ind = 1;\n neg_len = number1.length;\n }\n }\n if (number2[0] == \"-\") {\n number2 = number2.substring(1);\n if (!testZero(number2)) {\n neg++;\n ind = 2;\n neg_len = number2.length;\n }\n }\n\n number1 = trim(number1);\n number2 = trim(number2);\n\n [number1, number2] = pad(trim(number1), trim(number2));\n\n if (neg == 1) {\n if (ind === 1) number1 = compliment(number1);\n else if (ind === 2) number2 = compliment(number2);\n }\n\n let res = addCore(number1, number2);\n if (!neg) return trim(res);\n else if (neg == 2) return \"-\" + trim(res);\n else {\n if (number1.length < res.length) return trim(res.substring(1));\n else return \"-\" + trim(compliment(res));\n }\n}\n\nfunction compliment(number: string) {\n if (testZero(number)) {\n return number;\n }\n\n let s = \"\",\n l = number.length,\n dec = number.split(\".\")[1],\n ld = dec ? dec.length : 0;\n\n for (let i = 0; i < l; i++) {\n if (number[i] >= \"0\" && number[i] <= \"9\") s += 9 - parseInt(number[i]);\n else s += number[i];\n }\n\n let one = ld > 0 ? \"0.\" + new Array(ld).join(\"0\") + \"1\" : \"1\";\n\n return addCore(s, one);\n}\n\nexport function trim(number: string) {\n let parts = number.split(\".\");\n\n if (!parts[0]) parts[0] = \"0\";\n\n while (parts[0][0] == \"0\" && parts[0].length > 1)\n parts[0] = parts[0].substring(1);\n\n return parts[0] + (parts[1] ? \".\" + parts[1] : \"\");\n}\n\nexport function pad(number1: string, number2: string) {\n let parts1 = number1.split(\".\"),\n parts2 = number2.split(\".\");\n\n //pad integral part\n let length1 = parts1[0].length,\n length2 = parts2[0].length;\n if (length1 > length2) {\n parts2[0] =\n new Array(Math.abs(length1 - length2) + 1).join(\"0\") +\n (parts2[0] ? parts2[0] : \"\");\n } else {\n parts1[0] =\n new Array(Math.abs(length1 - length2) + 1).join(\"0\") +\n (parts1[0] ? parts1[0] : \"\");\n }\n\n //pad fractional part\n (length1 = parts1[1] ? parts1[1].length : 0),\n (length2 = parts2[1] ? parts2[1].length : 0);\n if (length1 || length2) {\n if (length1 > length2) {\n parts2[1] =\n (parts2[1] ? parts2[1] : \"\") +\n new Array(Math.abs(length1 - length2) + 1).join(\"0\");\n } else {\n parts1[1] =\n (parts1[1] ? parts1[1] : \"\") +\n new Array(Math.abs(length1 - length2) + 1).join(\"0\");\n }\n }\n\n number1 = parts1[0] + (parts1[1] ? \".\" + parts1[1] : \"\");\n number2 = parts2[0] + (parts2[1] ? \".\" + parts2[1] : \"\");\n\n return [number1, number2];\n}\n\nfunction addCore(number1: string, number2: string) {\n [number1, number2] = pad(number1, number2);\n\n let sum = \"\",\n carry = 0;\n\n for (let i = number1.length - 1; i >= 0; i--) {\n if (number1[i] === \".\") {\n sum = \".\" + sum;\n continue;\n }\n let temp = parseInt(number1[i]) + parseInt(number2[i]) + carry;\n sum = (temp % 10) + sum;\n carry = Math.floor(temp / 10);\n }\n\n return carry ? carry.toString() + sum : sum;\n}\n\nfunction testZero(number: string) {\n return /^0[0]*[.]{0,1}[0]*$/.test(number);\n}\n","export function abs(n: number | string | bigint) {\n if (typeof n == \"number\" || typeof n == \"bigint\") n = n.toString();\n if (n[0] == \"-\") return n.substring(1);\n return n;\n}\n","export enum RoundingModes {\n /**\n * Rounding mode to round towards positive infinity.\n */\n CEILING,\n\n /**\n * Rounding mode to round towards zero.\n */\n DOWN,\n\n /**\n * Rounding mode to round towards negative infinity.\n */\n FLOOR,\n\n /**\n * Rounding mode to round towards \"nearest neighbor\" unless both neighbors are equidistant, \n * in which case round down.\n */\n HALF_DOWN,\n\n /**\n * Rounding mode to round towards the \"nearest neighbor\" unless both neighbors are equidistant, \n * in which case, round towards the even neighbor.\n */\n HALF_EVEN,\n\n /**\n * Rounding mode to round towards \"nearest neighbor\" unless both neighbors are equidistant, \n * in which case round up.\n */\n HALF_UP,\n\n /**\n * Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary.\n * UNIMPLEMENTED\n */\n UNNECESSARY,\n\n /**\n * Rounding mode to round away from zero.\n */\n UP\n}\n\n","import { RoundingModes } from './roundingModes';\n/**\n * \n * @param input the number to round\n * @param n precision\n * @param mode Rounding Mode\n */\nexport function roundOff(input: number | string | bigint, n: number = 0, mode=RoundingModes.HALF_EVEN) {\n if (mode === RoundingModes.UNNECESSARY) {\n throw new Error(\"UNNECESSARY Rounding Mode has not yet been implemented\");\n }\n\n if (typeof (input) == 'number' || typeof (input) == 'bigint')\n input = input.toString();\n\n let neg = false;\n if (input[0] === '-') {\n neg = true;\n input = input.substring(1);\n }\n\n let parts = input.split('.'),\n partInt = parts[0],\n partDec = parts[1];\n\n //handle case of -ve n: roundOff(12564,-2)=12600\n if (n < 0) {\n n = -n;\n if (partInt.length <= n)\n return '0';\n else {\n let prefix = partInt.substr(0, partInt.length - n);\n input = prefix + '.' + partInt.substr(partInt.length - n) + partDec;\n prefix = roundOff(input, 0, mode);\n return (neg ? '-' : '') + prefix + (new Array(n + 1).join('0'));\n }\n }\n\n\n // handle case when integer output is desired\n if (n == 0) {\n let l = partInt.length;\n if (greaterThanFive(parts[1], partInt, neg, mode)) {\n partInt = increment(partInt);\n }\n return (neg&&parseInt(partInt) ? '-' : '') + partInt;\n }\n\n\n // handle case when n>0\n if (!parts[1]) {\n return (neg ? '-' : '') + partInt + '.' + (new Array(n + 1).join('0'));\n } else if (parts[1].length < n) {\n return (neg ? '-' : '') + partInt + '.' + parts[1] + (new Array(n - parts[1].length + 1).join('0'));\n }\n\n partDec = parts[1].substring(0, n);\n let rem = parts[1].substring(n);\n\n if (rem && greaterThanFive(rem, partDec, neg, mode)) {\n partDec = increment(partDec);\n if (partDec.length > n) {\n return (neg ? '-' : '') + increment(partInt, parseInt(partDec[0])) + '.' + partDec.substring(1);\n }\n }\n return (neg&&(parseInt(partInt) || parseInt(partDec)) ? '-' : '') + partInt + '.' + partDec;\n}\n\nfunction greaterThanFive(part: string, pre: string, neg: boolean, mode: RoundingModes) {\n if (!part || part === new Array(part.length + 1).join('0'))\n return false;\n\n // #region UP, DOWN, CEILING, FLOOR \n if (mode === RoundingModes.DOWN || (!neg && mode === RoundingModes.FLOOR) ||\n (neg && mode === RoundingModes.CEILING))\n return false;\n\n if (mode === RoundingModes.UP || (neg && mode === RoundingModes.FLOOR) ||\n (!neg && mode === RoundingModes.CEILING))\n return true;\n // #endregion\n\n // case when part !== five\n let five = '5' + (new Array(part.length).join('0'));\n if (part > five)\n return true;\n else if (part < five)\n return false;\n\n // case when part === five\n switch (mode) {\n case RoundingModes.HALF_DOWN: return false;\n case RoundingModes.HALF_UP: return true;\n case RoundingModes.HALF_EVEN:\n default: return (parseInt(pre[pre.length - 1]) % 2 == 1)\n }\n}\n\nfunction increment(part, c: number = 0) {\n if (!c)\n c = 1;\n if (typeof (part) == 'number')\n part.toString();\n\n let l = part.length - 1,\n s = '';\n\n for (let i = l; i >= 0; i--) {\n let x = parseInt(part[i]) + c;\n if (x == 10) {\n c = 1; x = 0;\n } else {\n c = 0;\n }\n s += x;\n }\n if (c)\n s += c;\n\n return s.split('').reverse().join('');\n}","export function multiply(number1, number2) {\n\tnumber1 = number1.toString();\n\tnumber2 = number2.toString();\n\n\t/*Filter numbers*/\n\tlet negative = 0;\n\tif (number1[0] == '-') {\n\t\tnegative++;\n\t\tnumber1 = number1.substr(1);\n\t}\n\tif (number2[0] == '-') {\n\t\tnegative++;\n\t\tnumber2 = number2.substr(1);\n\t}\n\tnumber1 = trailZero(number1);\n\tnumber2 = trailZero(number2);\n\tlet decimalLength1 = 0;\n\tlet decimalLength2 = 0;\n\n\tif (number1.indexOf('.') != -1) {\n\t\tdecimalLength1 = number1.length - number1.indexOf('.') - 1;\n\t}\n\n\tif (number2.indexOf('.') != -1) {\n\t\tdecimalLength2 = number2.length - number2.indexOf('.') - 1;\n\t}\n\tlet decimalLength = decimalLength1 + decimalLength2;\n\tnumber1 = trailZero(number1.replace('.', ''));\n\tnumber2 = trailZero(number2.replace('.', ''));\n\n\tif (number1.length < number2.length) {\n\t\tlet temp = number1;\n\t\tnumber1 = number2;\n\t\tnumber2 = temp;\n\t}\n\n\tif (number2 == '0') {\n\t\treturn '0';\n\t}\n\n\t/*\n\t* Core multiplication\n\t*/\n\tlet length = number2.length;\n\tlet carry = 0;\n\tlet positionVector = [];\n\tlet currentPosition = length - 1;\n\n\tlet result = \"\";\n\tfor (let i = 0; i < length; i++) {\n\t\tpositionVector[i] = number1.length - 1;\n\t}\n\tfor (let i = 0; i < 2 * number1.length; i++) {\n\t\tlet sum = 0;\n\t\tfor (let j = number2.length - 1; j >= currentPosition && j >= 0; j--) {\n\t\t\tif (positionVector[j] > -1 && positionVector[j] < number1.length) {\n\t\t\t\tsum += parseInt(number1[positionVector[j]--]) * parseInt(number2[j]);\n\t\t\t}\n\t\t}\n\t\tsum += carry;\n\t\tcarry = Math.floor(sum / 10);\n\t\tresult = sum % 10 + result;\n\t\tcurrentPosition--;\n\t}\n\t/*\n\t* Formatting result\n\t*/\n\tresult = trailZero(adjustDecimal(result, decimalLength));\n\tif (negative == 1) {\n\t\tresult = '-' + result;\n\t}\n\treturn result;\n}\n\n/*\n* Add decimal point\n*/\nfunction adjustDecimal(number, decimal) {\n\tif (decimal == 0)\n\t\treturn number;\n\telse {\n\t\tnumber = (decimal >= number.length) ? ((new Array(decimal - number.length + 1)).join('0') + number) : number;\n\t\treturn number.substr(0, number.length - decimal) + '.' + number.substr(number.length - decimal, decimal)\n\t}\n}\n\n/*\n* Removes zero from front and back*/\nfunction trailZero(number) {\n\twhile (number[0] == '0') {\n\t\tnumber = number.substr(1);\n\t}\n\tif (number.indexOf('.') != -1) {\n\t\twhile (number[number.length - 1] == '0') {\n\t\t\tnumber = number.substr(0, number.length - 1);\n\t\t}\n\t}\n\tif (number == \"\" || number == \".\") {\n\t\tnumber = '0';\n\t} else if (number[number.length - 1] == '.') {\n\t\tnumber = number.substr(0, number.length - 1);\n\t}\n\tif (number[0] == '.') {\n\t\tnumber = '0' + number;\n\t}\n\treturn number;\n}","import { add, trim } from './add';\nimport { roundOff } from './round';\n\nexport function divide(dividend, divisor, precission = 8) {\n if (divisor == 0) {\n throw new Error('Cannot divide by 0');\n }\n\n dividend = dividend.toString();\n divisor = divisor.toString();\n\n // remove trailing zeros in decimal ISSUE#18\n dividend = dividend.replace(/(\\.\\d*?[1-9])0+$/g, \"$1\").replace(/\\.0+$/, \"\");\n divisor = divisor.replace(/(\\.\\d*?[1-9])0+$/g, \"$1\").replace(/\\.0+$/, \"\");\n\n if (dividend == 0)\n return '0';\n\n let neg = 0;\n if (divisor[0] == '-') {\n divisor = divisor.substring(1);\n neg++;\n }\n if (dividend[0] == '-') {\n dividend = dividend.substring(1);\n neg++;\n }\n\n var pt_dvsr = divisor.indexOf('.') > 0 ? divisor.length - divisor.indexOf('.') - 1 : -1;\n\n divisor = trim(divisor.replace('.', ''));\n if (pt_dvsr >= 0) {\n let pt_dvnd = dividend.indexOf('.') > 0 ? dividend.length - dividend.indexOf('.') - 1 : -1;\n\n if (pt_dvnd == -1) {\n dividend = trim(dividend + (new Array(pt_dvsr + 1)).join('0'));\n } else {\n if (pt_dvsr > pt_dvnd) {\n dividend = dividend.replace('.', '');\n dividend = trim(dividend + (new Array(pt_dvsr - pt_dvnd + 1)).join('0'));\n } else if (pt_dvsr < pt_dvnd) {\n dividend = dividend.replace('.', '');\n let loc = dividend.length - pt_dvnd + pt_dvsr;\n dividend = trim(dividend.substring(0, loc) + '.' + dividend.substring(loc));\n } else if (pt_dvsr == pt_dvnd) {\n dividend = trim(dividend.replace('.', ''));\n }\n }\n }\n\n let prec = 0, dl = divisor.length, rem = '0', quotent = '';\n let dvnd = (dividend.indexOf('.') > -1 && dividend.indexOf('.') < dl) ? dividend.substring(0, dl + 1) : dividend.substring(0, dl);\n dividend = (dividend.indexOf('.') > -1 && dividend.indexOf('.') < dl) ? dividend.substring(dl + 1) : dividend.substring(dl);\n \n if (dvnd.indexOf('.') > -1) {\n let shift = dvnd.length - dvnd.indexOf('.') - 1;\n dvnd = dvnd.replace('.', '');\n if (dl > dvnd.length) {\n shift += dl - dvnd.length;\n dvnd = dvnd + (new Array(dl - dvnd.length + 1)).join('0');\n }\n prec = shift;\n quotent = '0.' + (new Array(shift)).join('0');\n\n }\n\n precission = precission + 2;\n\n while (prec <= precission) {\n let qt = 0;\n while (parseInt(dvnd) >= parseInt(divisor)) {\n dvnd = add(dvnd, '-' + divisor);\n qt++;\n }\n quotent += qt;\n\n if (!dividend) {\n if (!prec)\n quotent += '.';\n prec++;\n dvnd = dvnd + '0';\n } else {\n if (dividend[0] == '.') {\n quotent += '.';\n prec++;\n dividend = dividend.substring(1);\n }\n dvnd = dvnd + dividend.substring(0, 1);\n dividend = dividend.substring(1);\n }\n }\n\n return ((neg == 1) ? '-' : '') + trim(roundOff(quotent, precission - 2));\n}","import { add } from './add';\r\n\r\nexport function subtract(number1, number2) {\r\n\tnumber1 = number1.toString();\r\n\tnumber2 = number2.toString();\r\n\tnumber2 = negate(number2);\r\n\treturn add(number1, number2);\r\n}\r\n\r\nexport function negate(number : string){\r\n\tif(number[0] == '-'){\r\n\t\tnumber = number.substr(1);\r\n\t}else{\r\n\t\tnumber = '-' + number;\r\n\t}\r\n\treturn number;\r\n}","import { divide } from './divide';\nimport { roundOff } from './round';\nimport { multiply } from './multiply';\nimport { subtract } from './subtract';\nimport { RoundingModes } from './roundingModes';\n\nexport function modulus(dividend: number|string, divisor:number|string) {\n if (divisor == 0) {\n throw new Error('Cannot divide by 0');\n }\n\n dividend = dividend.toString();\n divisor = divisor.toString();\n\n validate(dividend);\n validate(divisor);\n\n let sign = '';\n if(dividend[0] == '-'){\n sign = '-';\n dividend = dividend.substr(1);\n }\n if(divisor[0] == '-'){\n divisor = divisor.substr(1);\n }\n\n let result = subtract(dividend, multiply(divisor, roundOff(divide(dividend, divisor), 0, RoundingModes.FLOOR)));\n return sign+result;\n}\n\nfunction validate(oparand: string) {\n if (oparand.indexOf('.') != -1) {\n throw new Error('Modulus of non-integers not supported');\n }\n}\n","import { pad } from './add';\r\n\r\nexport function compareTo(number1 : string, number2 : string) {\r\n\tlet negative = false;\r\n\tif(number1[0] == '-' && number2[0] != \"-\"){\r\n\t\treturn -1;\r\n\t}else if(number1[0] != '-' && number2[0] == '-'){\r\n\t\treturn 1;\r\n\t}else if(number1[0] == '-' && number2[0] == '-'){\r\n\t\tnumber1 = number1.substr(1);\r\n\t\tnumber2 = number2.substr(1);\r\n\t\tnegative = true;\r\n\t}\r\n\t[number1, number2] = pad(number1, number2);\r\n\tif(number1.localeCompare(number2) == 0){\r\n\t\treturn 0;\r\n\t}\r\n\tfor(let i = 0 ; i < number1.length ; i++){\r\n\t\tif(number1[i] == number2[i]){\r\n\t\t\tcontinue;\r\n\t\t}else if(number1[i] > number2[i]){\r\n\t\t\tif(negative){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(negative){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn 0;\r\n}","import { add, trim } from \"./add\";\r\nimport { abs } from \"./abs\";\r\nimport { roundOff } from \"./round\";\r\nimport { multiply } from \"./multiply\";\r\nimport { divide } from \"./divide\";\r\nimport { modulus } from \"./modulus\";\r\nimport { compareTo } from \"./compareTo\";\r\nimport { subtract, negate } from \"./subtract\";\r\nimport { RoundingModes as Modes, RoundingModes } from \"./roundingModes\";\r\n\r\nclass bigDecimal {\r\n private value: string;\r\n static RoundingModes = Modes;\r\n\r\n private static validate(number): string {\r\n if (number) {\r\n number = number.toString();\r\n if (isNaN(number)) throw Error(\"Parameter is not a number: \" + number);\r\n\r\n if (number[0] == \"+\") number = number.substring(1);\r\n } else number = \"0\";\r\n\r\n //handle missing leading zero\r\n if (number.startsWith(\".\")) number = \"0\" + number;\r\n else if (number.startsWith(\"-.\")) number = \"-0\" + number.substr(1);\r\n\r\n //handle exponentiation\r\n if (/e/i.test(number)) {\r\n let [mantisa, exponent] = number.split(/[eE]/);\r\n mantisa = trim(mantisa);\r\n\r\n let sign = \"\";\r\n if (mantisa[0] == \"-\") {\r\n sign = \"-\";\r\n mantisa = mantisa.substring(1);\r\n }\r\n\r\n if (mantisa.indexOf(\".\") >= 0) {\r\n exponent = parseInt(exponent) + mantisa.indexOf(\".\");\r\n mantisa = mantisa.replace(\".\", \"\");\r\n } else {\r\n exponent = parseInt(exponent) + mantisa.length;\r\n }\r\n\r\n if (mantisa.length < exponent) {\r\n number =\r\n sign + mantisa + new Array(exponent - mantisa.length + 1).join(\"0\");\r\n } else if (mantisa.length >= exponent && exponent > 0) {\r\n number =\r\n sign +\r\n trim(mantisa.substring(0, exponent)) +\r\n (mantisa.length > exponent ? \".\" + mantisa.substring(exponent) : \"\");\r\n } else {\r\n number = sign + \"0.\" + new Array(-exponent + 1).join(\"0\") + mantisa;\r\n }\r\n }\r\n\r\n return number;\r\n }\r\n\r\n constructor(number: number | string | bigint = \"0\") {\r\n this.value = bigDecimal.validate(number);\r\n }\r\n\r\n getValue() {\r\n return this.value;\r\n }\r\n\r\n setValue(num: number | string | bigint) {\r\n this.value = bigDecimal.validate(num);\r\n }\r\n\r\n static getPrettyValue(number, digits = 3, separator = \",\"): string {\r\n // if (!(digits || separator)) {\r\n // digits = 3;\r\n // separator = ',';\r\n // } else if (!(digits && separator)) {\r\n // throw Error('Illegal Arguments. Should pass both digits and separator or pass none');\r\n // }\r\n number = bigDecimal.validate(number);\r\n let neg = number.charAt(0) == \"-\";\r\n if (neg) number = number.substring(1);\r\n var len = number.indexOf(\".\");\r\n len = len > 0 ? len : number.length;\r\n var temp = \"\";\r\n for (var i = len; i > 0; ) {\r\n if (i < digits) {\r\n digits = i;\r\n i = 0;\r\n } else i -= digits;\r\n\r\n temp =\r\n number.substring(i, i + digits) +\r\n (i < len - digits && i >= 0 ? separator : \"\") +\r\n temp;\r\n }\r\n return (neg ? \"-\" : \"\") + temp + number.substring(len);\r\n }\r\n getPrettyValue(digits = 3, separator = \",\") {\r\n return bigDecimal.getPrettyValue(this.value, digits, separator);\r\n }\r\n\r\n static round(number, precision = 0, mode = Modes.HALF_EVEN) {\r\n number = bigDecimal.validate(number);\r\n // console.log(number)\r\n if (isNaN(precision))\r\n throw Error(\"Precision is not a number: \" + precision);\r\n return roundOff(number, precision, mode);\r\n }\r\n\r\n round(precision = 0, mode = Modes.HALF_EVEN) {\r\n if (isNaN(precision))\r\n throw Error(\"Precision is not a number: \" + precision);\r\n\r\n return new bigDecimal(roundOff(this.value, precision, mode));\r\n }\r\n\r\n static abs(number) {\r\n number = bigDecimal.validate(number);\r\n return abs(number);\r\n }\r\n\r\n abs() {\r\n return new bigDecimal(abs(this.value));\r\n }\r\n\r\n static floor(number) {\r\n number = bigDecimal.validate(number);\r\n if (number.indexOf(\".\") === -1) return number;\r\n return bigDecimal.round(number, 0, RoundingModes.FLOOR);\r\n }\r\n\r\n floor() {\r\n if (this.value.indexOf(\".\") === -1) return new bigDecimal(this.value);\r\n return new bigDecimal(this.value).round(0, RoundingModes.FLOOR);\r\n }\r\n\r\n static ceil(number) {\r\n number = bigDecimal.validate(number);\r\n if (number.indexOf(\".\") === -1) return number;\r\n return bigDecimal.round(number, 0, RoundingModes.CEILING);\r\n }\r\n\r\n ceil() {\r\n if (this.value.indexOf(\".\") === -1) return new bigDecimal(this.value);\r\n return new bigDecimal(this.value).round(0, RoundingModes.CEILING);\r\n }\r\n\r\n static add(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return add(number1, number2);\r\n }\r\n\r\n add(number: bigDecimal) {\r\n return new bigDecimal(add(this.value, number.getValue()));\r\n }\r\n\r\n static subtract(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return subtract(number1, number2);\r\n }\r\n\r\n subtract(number: bigDecimal) {\r\n return new bigDecimal(subtract(this.value, number.getValue()));\r\n }\r\n\r\n static multiply(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return multiply(number1, number2);\r\n }\r\n\r\n multiply(number: bigDecimal) {\r\n return new bigDecimal(multiply(this.value, number.getValue()));\r\n }\r\n\r\n static divide(number1, number2, precision?: number) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return divide(number1, number2, precision);\r\n }\r\n\r\n divide(number: bigDecimal, precision?: number) {\r\n return new bigDecimal(divide(this.value, number.getValue(), precision));\r\n }\r\n\r\n static modulus(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return modulus(number1, number2);\r\n }\r\n\r\n modulus(number: bigDecimal) {\r\n return new bigDecimal(modulus(this.value, number.getValue()));\r\n }\r\n\r\n static compareTo(number1, number2) {\r\n number1 = bigDecimal.validate(number1);\r\n number2 = bigDecimal.validate(number2);\r\n return compareTo(number1, number2);\r\n }\r\n\r\n compareTo(number: bigDecimal) {\r\n return compareTo(this.value, number.getValue());\r\n }\r\n\r\n static negate(number) {\r\n number = bigDecimal.validate(number);\r\n return negate(number);\r\n }\r\n\r\n negate() {\r\n return new bigDecimal(negate(this.value));\r\n }\r\n}\r\nexport default bigDecimal;\r\n"],"names":["Modes"],"mappings":"AAAA;AACgB,SAAA,GAAG,CAAC,OAAe,EAAE,OAAa,EAAA;;AAAb,IAAA,IAAA,OAAA,KAAA,KAAA,CAAA,EAAA,EAAA,OAAa,GAAA,GAAA,CAAA,EAAA;IAC5C,IAAA,GAAG,GAAG,CAAC,CACT,CAAA,GAAG,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;AAC/B,QAAA,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACvC,QAAA,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACvC,QAAA,OAAO,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;KACpC,CAAA;IAED,UAAS,CAAA,SAAA,CAAA,SAAA,GAAT,UAAU,MAAkB,EAAA;QAC1B,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;KACjD,CAAA;IAEM,UAAM,CAAA,MAAA,GAAb,UAAc,MAAM,EAAA;AAClB,QAAA,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACrC,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;KACvB,CAAA;AAED,IAAA,UAAA,CAAA,SAAA,CAAA,MAAM,GAAN,YAAA;QACE,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;KAC3C,CAAA;IA3MM,UAAa,CAAA,aAAA,GAAGA,aAAK,CAAC;IA4M/B,OAAC,UAAA,CAAA;AAAA,CA9MD,EA8MC;;;;"} \ No newline at end of file diff --git a/dist/node/big-decimal.d.ts b/dist/node/big-decimal.d.ts index 556d018..40c9c75 100644 --- a/dist/node/big-decimal.d.ts +++ b/dist/node/big-decimal.d.ts @@ -23,7 +23,7 @@ declare class bigDecimal { static multiply(number1: any, number2: any): string; multiply(number: bigDecimal): bigDecimal; static divide(number1: any, number2: any, precision?: number): string; - divide(number: bigDecimal, precision: any): bigDecimal; + divide(number: bigDecimal, precision?: number): bigDecimal; static modulus(number1: any, number2: any): string; modulus(number: bigDecimal): bigDecimal; static compareTo(number1: any, number2: any): 0 | 1 | -1; diff --git a/src/big-decimal.ts b/src/big-decimal.ts index 582dd3c..7cf1d7f 100644 --- a/src/big-decimal.ts +++ b/src/big-decimal.ts @@ -182,7 +182,7 @@ class bigDecimal { return divide(number1, number2, precision); } - divide(number: bigDecimal, precision) { + divide(number: bigDecimal, precision?: number) { return new bigDecimal(divide(this.value, number.getValue(), precision)); }