cmath-js 5.3.3 → 5.3.4
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 +21 -21
- package/dist/namespace-std/all-numbers/iota.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,25 +4,25 @@ Implementation of parts of C++'s numerics libraries in TypeScript/JavaScript, in
|
|
|
4
4
|
|
|
5
5
|
## Floating-point functions
|
|
6
6
|
|
|
7
|
-
- [`copysign`](https://en.cppreference
|
|
8
|
-
- [`fabs`](https://en.cppreference
|
|
7
|
+
- [`copysign`](https://en.cppreference/numeric/math/copysign)
|
|
8
|
+
- [`fabs`](https://en.cppreference/numeric/math/fabs)
|
|
9
9
|
- [`fpclassify`](https://en.cppreference.com/c/numeric/math/fpclassify)
|
|
10
|
-
- [`frexp`](https://en.cppreference
|
|
11
|
-
- [`hypot`](https://en.
|
|
10
|
+
- [`frexp`](https://en.cppreference/numeric/math/frexp)
|
|
11
|
+
- [`hypot`](https://en.cppreferencepp/numeric/math/hypot)
|
|
12
12
|
- [`iscanonical`](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf#subsection.7.12.3)
|
|
13
13
|
- [`isfinite`](https://en.cppreference.com/c/numeric/math/isfinite)
|
|
14
|
-
- [`isinf`](https://en.cppreference
|
|
15
|
-
- [`ldexp`](https://en.cppreference
|
|
16
|
-
- [`nan`](https://en.cppreference
|
|
17
|
-
- [`nextafter`](https://en.cppreference
|
|
18
|
-
- [`pow`](https://en.cppreference
|
|
14
|
+
- [`isinf`](https://en.cppreference/numeric/math/isinf)
|
|
15
|
+
- [`ldexp`](https://en.cppreference/numeric/math/ldexp)
|
|
16
|
+
- [`nan`](https://en.cppreference/numeric/math/nan)
|
|
17
|
+
- [`nextafter`](https://en.cppreference/numeric/math/nextafter)
|
|
18
|
+
- [`pow`](https://en.cppreference/numeric/math/pow)
|
|
19
19
|
|
|
20
20
|
## Integer functions
|
|
21
21
|
|
|
22
22
|
These functions accept either a `bigint` or an integer `number`:
|
|
23
23
|
|
|
24
|
-
- [`abs`](https://en.cppreference
|
|
25
|
-
- [`countl_one`](https://en.
|
|
24
|
+
- [`abs`](https://en.cppreference/numeric/math/abs)
|
|
25
|
+
- [`countl_one`](https://en.cppreferencepp/numeric/countl_one) as `create_countl_one`, which is used this way:
|
|
26
26
|
```ts
|
|
27
27
|
import { create_countl_one } from "cmath-js";
|
|
28
28
|
const countl_one_u16 = create_countl_one({ bits: 16 });
|
|
@@ -32,27 +32,27 @@ These functions accept either a `bigint` or an integer `number`:
|
|
|
32
32
|
`${integer.toString(2).padStart(16, "0")} has ${countl_one_u16(integer)} leading one bits.`,
|
|
33
33
|
);
|
|
34
34
|
```
|
|
35
|
-
- [`countl_zero`](https://en.
|
|
36
|
-
- [`countr_one`](https://en.
|
|
37
|
-
- [`countr_zero`](https://en.
|
|
38
|
-
- [`div`](https://en.
|
|
39
|
-
- [`gcd`](https://en.
|
|
35
|
+
- [`countl_zero`](https://en.cppreferencepp/numeric/countl_zero) as `create_countl_zero`
|
|
36
|
+
- [`countr_one`](https://en.cppreferencepp/numeric/countr_one) as `create_countr_one`
|
|
37
|
+
- [`countr_zero`](https://en.cppreferencepp/numeric/countr_zero) as `create_countr_zero`
|
|
38
|
+
- [`div`](https://en.cppreferencepp/numeric/math/div)
|
|
39
|
+
- [`gcd`](https://en.cppreferencepp/numeric/gcd). Example:
|
|
40
40
|
```ts
|
|
41
41
|
import { gcd } from "cmath-js";
|
|
42
42
|
// Prints "The greatest common divisor of 24 and 32 is 8."
|
|
43
43
|
console.log(`The greatest common divisor of 24 and 32 is ${gcd(24, 32)}.`);
|
|
44
44
|
```
|
|
45
|
-
- [`lcm`](https://en.
|
|
46
|
-
- [`popcount`](https://en.
|
|
45
|
+
- [`lcm`](https://en.cppreferencepp/numeric/lcm)
|
|
46
|
+
- [`popcount`](https://en.cppreferencepp/numeric/popcount)
|
|
47
47
|
|
|
48
48
|
## Functions for both floats and ints
|
|
49
49
|
|
|
50
|
-
- [`iota`](https://en.cppreference.com/
|
|
51
|
-
- [`signbit`](https://en.cppreference.com/
|
|
50
|
+
- [`iota`](https://en.cppreference.com/cpp/algorithm/iota)
|
|
51
|
+
- [`signbit`](https://en.cppreference.com/c/numeric/math/signbit)
|
|
52
52
|
|
|
53
53
|
## Mathematical constants
|
|
54
54
|
|
|
55
|
-
- Constants in [the `std::numbers` namespace](https://en.
|
|
55
|
+
- Constants in [the `std::numbers` namespace](https://en.cppreferencepp/numeric/constants) are available from the `numbers` subpath export. Example:
|
|
56
56
|
```ts
|
|
57
57
|
import { sqrt3 } from "cmath-js/numbers";
|
|
58
58
|
console.log(`The square root of 3 is ${sqrt3}.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iota.js","sourceRoot":"","sources":["../../../src/namespace-std/all-numbers/iota.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"iota.js","sourceRoot":"","sources":["../../../src/namespace-std/all-numbers/iota.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,IAAI,CAAC,eAAoC,EAAE,UAA2B;IACrF,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjC,IAAI,KAAK,GAAG,UAAU,CAAC;IACvB,KAAK,MAAM,KAAK,IAAI,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC;QAC5C,eAAe,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC;IAClC,CAAC;AACF,CAAC"}
|