bigint-decimal 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # BigintDecimal
2
2
 
3
+ ![NPM Version](https://img.shields.io/npm/v/bigint-decimal)
4
+ ![Build Status](https://img.shields.io/github/actions/workflow/status/Generalsimus/bigint-decimal/publish.yml)
5
+ ![License](https://img.shields.io/npm/l/bigint-decimal)
6
+
3
7
  A blazing-fast, zero-dependency, arbitrary-precision decimal math library for TypeScript and JavaScript. Built on native `BigInt` to safely handle massive numbers, exact decimals, and eliminate floating-point errors.
4
8
 
5
9
  Perfect for financial applications, trading platforms, and anywhere precise calculation is critical.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigint-decimal",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A zero-dependency, arbitrary-precision decimal math library using native BigInt for safe financial and crypto calculations.",
5
5
  "main": "./dist/global/index.js",
6
6
  "author": "soso tsertsvadze",
@@ -8,7 +8,7 @@
8
8
  "scripts": {
9
9
  "test": "jest",
10
10
  "dev": "tsc -w --project tsconfig.common.json & tsc -w --project tsconfig.global.json & node --watch --watch-preserve-output ./dist/common/index.js & wait",
11
- "build": "tsc --project tsconfig.node.json && tsc --project tsconfig.global.json"
11
+ "build": "tsc --project tsconfig.common.json && tsc --project tsconfig.global.json"
12
12
  },
13
13
  "publishConfig": {
14
14
  "access": "public",
@@ -41,4 +41,4 @@
41
41
  "jest": "^30.3.0",
42
42
  "ts-jest": "^29.4.6"
43
43
  }
44
- }
44
+ }
@@ -1,2 +0,0 @@
1
- export declare const createBigintPermutations: (size: bigint, momentumSize: bigint) => bigint[];
2
- export declare const createNumberPermutations: (size: number, momentumSize: number) => number[];
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNumberPermutations = exports.createBigintPermutations = void 0;
4
- const factorial = (n) => {
5
- let result = 1n;
6
- for (let i = 1n; i <= n; i++) {
7
- result *= i;
8
- }
9
- return result;
10
- };
11
- const permutationsBigint = (n, r) => factorial(n) / factorial(n - r);
12
- const createBigintPermutations = (size, momentumSize) => {
13
- const permutations = [];
14
- for (let i = 0n; i < momentumSize; i++) {
15
- permutations.push(permutationsBigint(size - i - 1n, momentumSize - i - 1n));
16
- }
17
- return permutations;
18
- };
19
- exports.createBigintPermutations = createBigintPermutations;
20
- const createNumberPermutations = (size, momentumSize) => {
21
- return (0, exports.createBigintPermutations)(BigInt(size), BigInt(momentumSize)).map(Number);
22
- };
23
- exports.createNumberPermutations = createNumberPermutations;
24
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../utils.ts"],"names":[],"mappings":";;;AAAA,MAAM,SAAS,GAAG,CAAC,CAAS,EAAU,EAAE;IACpC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAChD,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAG7B,MAAM,wBAAwB,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAE,EAAE;IAC3E,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,YAAY,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAC/E,CAAC;IACD,OAAO,YAAY,CAAA;AACvB,CAAC,CAAA;AANY,QAAA,wBAAwB,4BAMpC;AAEM,MAAM,wBAAwB,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAE,EAAE;IAC3E,OAAO,IAAA,gCAAwB,EAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACnF,CAAC,CAAA;AAFY,QAAA,wBAAwB,4BAEpC"}
@@ -1,2 +0,0 @@
1
- export declare const createBigintPermutations: (size: bigint, momentumSize: bigint) => bigint[];
2
- export declare const createNumberPermutations: (size: number, momentumSize: number) => number[];
@@ -1,19 +0,0 @@
1
- const factorial = (n) => {
2
- let result = 1n;
3
- for (let i = 1n; i <= n; i++) {
4
- result *= i;
5
- }
6
- return result;
7
- };
8
- const permutationsBigint = (n, r) => factorial(n) / factorial(n - r);
9
- export const createBigintPermutations = (size, momentumSize) => {
10
- const permutations = [];
11
- for (let i = 0n; i < momentumSize; i++) {
12
- permutations.push(permutationsBigint(size - i - 1n, momentumSize - i - 1n));
13
- }
14
- return permutations;
15
- };
16
- export const createNumberPermutations = (size, momentumSize) => {
17
- return createBigintPermutations(BigInt(size), BigInt(momentumSize)).map(Number);
18
- };
19
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../utils.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,CAAC,CAAS,EAAU,EAAE;IACpC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAChD,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAGpC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAE,EAAE;IAC3E,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,YAAY,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAC/E,CAAC;IACD,OAAO,YAAY,CAAA;AACvB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAE,EAAE;IAC3E,OAAO,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACnF,CAAC,CAAA"}