powiaina_num.js 0.1.12 → 0.2.0-alpha.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
@@ -4,11 +4,68 @@ 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,layer and array. Sign is 1 or -1. Array is \[n<sub>0</sub>,\[a<sub>0</sub>, a<sub>1</sub>, a<sub>2</sub>, a<sub>3</sub>], \[b<sub>0</sub>, b<sub>1</sub>, b<sub>2</sub>, b<sub>3</sub>], ...]. They together represents {10,{10,...{10,{10,{...{10, n<sub>0</sub>...}...},c<sub>0</sub>,c<sub>2</sub>,c<sub>3</sub>}...,b<sub>0</sub>,b<sub>2</sub>,b<sub>3</sub>},b<sub>0</sub>,b<sub>2</sub>,b<sub>3</sub>}.
8
- (b<sub>1</sub> is how many {10, ... ,b<sub>0</sub>,b<sub>2</sub>,b<sub>3</sub>}'s )
7
+ Internally, it is represented as an sign,layer, small and array. Sign is 1 or -1. It's 10{oper.arrow, oper.expans, oper.megota}, If arrow count or expans count is Infinite, the count replaces from the next operators.
8
+
9
9
  Some codes snippet from [ExpantaNum.js by Naruyoko](https://github.com/Naruyoko/ExpantaNum.js)
10
10
 
11
- Functions are as follows `abs, neg, add, sub, mul, div, rec, pow, exp, sqrt, cbrt, root, log10, logarithm, logBase, f_lambertw, d_lambertw, lambertw, tetrate, expansion(eps), multiExpansion(mulEps), powerExpansion(powEps), explosion(els), cmp, isFinite, isInfinite, isNaN, iteratedlog, iteratedslog, iteratedexp, pentate, arrow`(some missing items that have not been fully developed)
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)
12
+
13
+ ## Using
14
+
15
+ The library exports a class,
16
+ Create a PowiainaNum.js object like this:
17
+
18
+ ```javascript
19
+ import PowiainaNum from "powiaina_num.js";
20
+
21
+ let a = new PowiainaNum(); // create PN.js number with NaN
22
+ let b = new PowiainaNum(3); // create PN.js number with number 3
23
+ let c = new PowiainaNum("1e114514"); // create PN.js number with number 10^114514
24
+
25
+ let d = new PowiainaNum(c); // create PN.js number from a PN.js number
26
+ ```
27
+
28
+ Javascript operators will not work such as `+`, `-`, etc.
29
+ You should call the equivalent functions instead.
30
+
31
+ ```javascript
32
+ let a = new PowiainaNum(114514);
33
+ let b = new PowiainaNum(1919810);
34
+
35
+ // Calculate a+b:
36
+ let c = a.add(b); // 1919810+114514
37
+
38
+ // Calculate a-b:
39
+ let c = a.sub(b);
40
+
41
+ a.mul(b); // a*b
42
+ a.div(b); // a/b
43
+ a.pow(b); // a^b
44
+
45
+ a.log10(); // log10(a)
46
+
47
+ // comparing PN.js numbers
48
+
49
+ a.lt(b); // a is less than b
50
+ a.gt(b); // a is greater than b
51
+ a.eq(b); // a is equals to b
52
+ ```
53
+
54
+ ## Future ideas
55
+
56
+ Extend `Operator` to nearly infinite keys to reach level f<sub>ω<sup>ω</sup></sub>
57
+
58
+ ```typescript
59
+ interface Operator {
60
+ /*P3*/ arrow: number;
61
+ /*P4*/ expans: number;
62
+ /*P5*/ megota: number;
63
+ /*P6*/ powiaina: number;
64
+ P7: number;
65
+ .....
66
+
67
+ repeat: number;
12
68
 
13
- ## How does it come from
14
- PowiainaNum.js是我基于ExpantaNum.js的基础上修改结构而得来的。我将原先的\[number, number\]\[\]结构改成了\[number,number,number,number\]\[\]结构,并将"x"特殊值运用在里面,再修改程序逻辑而得出来。
69
+ valuereplaced?: -1 | 0 | 1 | 2 | ...
70
+ }
71
+ ```