cmath-js 1.2.0 → 1.3.0
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 +2 -1
- package/dist/all-numbers/index.d.ts +1 -0
- package/dist/all-numbers/index.js +1 -0
- package/dist/all-numbers/index.js.map +1 -1
- package/dist/integers/div.d.ts +6 -0
- package/dist/integers/div.js +8 -0
- package/dist/integers/div.js.map +1 -0
- package/dist/integers/div_bigint.d.ts +5 -0
- package/dist/integers/div_bigint.js +13 -0
- package/dist/integers/div_bigint.js.map +1 -0
- package/dist/integers/div_number.d.ts +5 -0
- package/dist/integers/div_number.js +11 -0
- package/dist/integers/div_number.js.map +1 -0
- package/dist/integers/index.d.ts +1 -0
- package/dist/integers/index.js +1 -0
- package/dist/integers/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,12 +17,13 @@ These functions accept either a `bigint` or an integer `number`:
|
|
|
17
17
|
- [`countl_zero`](https://en.cppreference.com/w/cpp/numeric/countl_zero)
|
|
18
18
|
- [`countr_one`](https://en.cppreference.com/w/cpp/numeric/countr_one)
|
|
19
19
|
- [`countr_zero`](https://en.cppreference.com/w/cpp/numeric/countr_zero)
|
|
20
|
+
- [`div`](https://en.cppreference.com/w/cpp/numeric/math/div)
|
|
20
21
|
- [`gcd`](https://en.cppreference.com/w/cpp/numeric/gcd)
|
|
21
22
|
- [`lcm`](https://en.cppreference.com/w/cpp/numeric/lcm)
|
|
22
23
|
- [`popcount`](https://en.cppreference.com/w/cpp/numeric/popcount)
|
|
23
24
|
|
|
24
25
|
## Functions for both floats and ints
|
|
25
|
-
- [`iota`](https://en.cppreference.com/w/cpp/
|
|
26
|
+
- [`iota`](https://en.cppreference.com/w/cpp/algorithm/iota)
|
|
26
27
|
- [`signbit`](https://en.cppreference.com/w/c/numeric/math/signbit)
|
|
27
28
|
|
|
28
29
|
## Test coverage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/all-numbers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/all-numbers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type div_t_bigint } from "./div_bigint";
|
|
2
|
+
import { type div_t_number } from "./div_number";
|
|
3
|
+
export { type div_t_bigint };
|
|
4
|
+
export { type div_t_number };
|
|
5
|
+
export declare function div(aInteger: bigint, bInteger: bigint): div_t_bigint;
|
|
6
|
+
export declare function div(aInteger: number, bInteger: number): div_t_number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { div_bigint } from "./div_bigint";
|
|
2
|
+
import { div_number } from "./div_number";
|
|
3
|
+
export function div(aInteger, bInteger) {
|
|
4
|
+
return typeof aInteger === "number"
|
|
5
|
+
? div_number(aInteger, bInteger)
|
|
6
|
+
: div_bigint(aInteger, bInteger);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=div.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"div.js","sourceRoot":"","sources":["../../src/integers/div.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAqB,MAAM,cAAc,CAAC;AAO7D,MAAM,UAAU,GAAG,CAClB,QAAyB,EACzB,QAAyB;IAEzB,OAAO,OAAO,QAAQ,KAAK,QAAQ;QAClC,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAkB,CAAC;QAC1C,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAkB,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"div_bigint.js","sourceRoot":"","sources":["../../src/integers/div_bigint.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,QAAgB;IAG5D,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO;YACN,IAAI,EAAE,EAAE;YACR,GAAG,EAAE,EAAE;SACP,CAAC;IACH,CAAC;IAED,OAAO;QACN,IAAI,EAAE,QAAQ,GAAG,QAAQ;QACzB,GAAG,EAAE,QAAQ,GAAG,QAAQ;KACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"div_number.js","sourceRoot":"","sources":["../../src/integers/div_number.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,QAAgB;IAM5D,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,IAAI,GAAG,CAAC,CAAC;IACV,CAAC;IAED,OAAO;QACN,IAAI;QACJ,GAAG,EAAE,QAAQ,GAAG,QAAQ,IAAI,CAAC;KAC7B,CAAC;AACH,CAAC"}
|
package/dist/integers/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { countl_one } from "./countl_one.js";
|
|
|
3
3
|
export { countl_zero } from "./countl_zero.js";
|
|
4
4
|
export { countr_one } from "./countr_one.js";
|
|
5
5
|
export { countr_zero } from "./countr_zero.js";
|
|
6
|
+
export { div, type div_t_bigint, type div_t_number } from "./div.js";
|
|
6
7
|
export { gcd } from "./gcd.js";
|
|
7
8
|
export { lcm } from "./lcm.js";
|
|
8
9
|
export { popcount } from "./popcount.js";
|
package/dist/integers/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export { countl_one } from "./countl_one.js";
|
|
|
3
3
|
export { countl_zero } from "./countl_zero.js";
|
|
4
4
|
export { countr_one } from "./countr_one.js";
|
|
5
5
|
export { countr_zero } from "./countr_zero.js";
|
|
6
|
+
export { div } from "./div.js";
|
|
6
7
|
export { gcd } from "./gcd.js";
|
|
7
8
|
export { lcm } from "./lcm.js";
|
|
8
9
|
export { popcount } from "./popcount.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAwC,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|