powiaina_num.js 0.2.0-alpha.2.1 → 0.2.0-alpha.2.11
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 +30 -3
- package/dist/PowiainaNum.cjs.js +816 -77
- package/dist/PowiainaNum.esm.js +816 -77
- package/dist/PowiainaNum.js +817 -78
- package/dist/PowiainaNum.min.js +1 -1
- package/dist/index.d.ts +84 -5
- package/dist/index.js +1762 -0
- package/dist/types/index.d.ts +184 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,11 +4,22 @@ A JavaScript library that handles arithmetic for numbers as large as {10,9e15,1,
|
|
|
4
4
|
|
|
5
5
|
This reaches level f<sub>ω<sup>3</sup>+1</sub>.
|
|
6
6
|
|
|
7
|
-
Internally, it is represented as an sign,
|
|
7
|
+
Internally, it is represented as an sign, array, small, and layer. Sign is 1 or -1. . Layer is a non-negative integer.
|
|
8
|
+
|
|
9
|
+
The operator interface is `interface {arrow: number; expans: number; megota: number; repeat: number;}`, which respents {10, {10, ...{10, X, arrow, expans, megota}..., arrow, expans, megota}, arrow, expans, megota} (repeat means counts of 10's);
|
|
10
|
+
|
|
11
|
+
The array is `Operator[]`
|
|
12
|
+
|
|
13
|
+
when $$f(x) = \{10, 10, 10, 10, 10, x\}$$
|
|
14
|
+
$$g_{a,b,c}(x) = \{10,x,a,b,c\}$$
|
|
15
|
+
$$o_x = \text{last }x\text{th operator of array} $$
|
|
16
|
+
They together respents $s_{ign}\times f^{l_{ayer}} g_{o_1.arrow, o_1.expans, o_1.megota} g_{o_2.arrow, o_2.expans, o_2.megota} ...$
|
|
17
|
+
|
|
18
|
+
If arrow count or expans count is Infinite, the count replaces to the next operators.
|
|
8
19
|
|
|
9
20
|
Some codes snippet from [ExpantaNum.js by Naruyoko](https://github.com/Naruyoko/ExpantaNum.js)
|
|
10
21
|
|
|
11
|
-
Functions are as follows `abs, neg, add, sub, mul, div, rec, pow, sqrt, cbrt, root, log10, log, cmp, isFinite, isInfinite, isNaN`(some missing items that have not been fully developed)
|
|
22
|
+
Functions are as follows `abs, neg, add, sub, mul, div, rec, pow, pow10, pow_base, sqrt, cbrt, root, log10, log, cmp, rec, gamma, mod, exp, ln, slog, factorial, tetrate_10, isFinite, isInfinite, isNaN, tetrate, lambertw, toString, toJSON, floor, ceil, round, trunc`(some missing items that have not been fully developed)
|
|
12
23
|
|
|
13
24
|
## Using
|
|
14
25
|
|
|
@@ -16,13 +27,29 @@ The library exports a class,
|
|
|
16
27
|
Create a PowiainaNum.js object like this:
|
|
17
28
|
|
|
18
29
|
```javascript
|
|
19
|
-
import PowiainaNum from "powiaina_num.js";
|
|
30
|
+
import PowiainaNum from "powiaina_num.js"; // static import
|
|
31
|
+
const { default: PowiainaNum } = await import("powiaina_num.js") // dynamic import
|
|
20
32
|
|
|
21
33
|
let a = new PowiainaNum(); // create PN.js number with NaN
|
|
22
34
|
let b = new PowiainaNum(3); // create PN.js number with number 3
|
|
23
35
|
let c = new PowiainaNum("1e114514"); // create PN.js number with number 10^114514
|
|
24
36
|
|
|
25
37
|
let d = new PowiainaNum(c); // create PN.js number from a PN.js number
|
|
38
|
+
|
|
39
|
+
let e = new PowiainaNum([[0,23.2352],[1,2],[2,6],[3,0],[4,1],[5,4]]); // You can also use a pair number array which from ExpantaNum.js
|
|
40
|
+
|
|
41
|
+
let f = new PowiainaNum("(10^^^)^114514 e1919810") // ExpantaNum.js string form
|
|
42
|
+
|
|
43
|
+
let g = new PowiainaNum("10{!}e1919810") // 10{!} = 10{x}10, x points to e1919810, 10{!} = J in ExpantaNum.js
|
|
44
|
+
let h = new PowiainaNum("10{1,2}ee114514") // {10, ee114514, 1, 2}
|
|
45
|
+
let i = new PowiainaNum("10{1,514,114}ee114514") // {10, ee114514, 1, 514, 114}
|
|
46
|
+
let j = new PowiainaNum("/10{1,514,114}ee114514") // Very small numbers ({10, ee114514, 1, 514, 114})^-1
|
|
47
|
+
let k = new PowiainaNum("(e^114514)1919810") // break_eternity.js (e^x) form
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
In browser, you can download `dist/PowiainaNum.min.js` or use
|
|
51
|
+
```html
|
|
52
|
+
<script src="https://unpkg.com/powiaina_num.js@alpha"></script>
|
|
26
53
|
```
|
|
27
54
|
|
|
28
55
|
Javascript operators will not work such as `+`, `-`, etc.
|