metanum 1.0.0 → 1.2.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 +157 -69
- package/metanum.js +5695 -3788
- package/package.json +1 -1
- package/test-interface.html +1 -1
- package/test_mixed.js +349 -16
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# MetaNum
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/metanum)
|
|
4
|
+
|
|
5
|
+
- MetaNum v1.2 by dlsdl
|
|
4
6
|
|
|
5
7
|
A huge number library holding up to X↑↑X&9e15.
|
|
6
8
|
|
|
@@ -29,8 +31,8 @@ const b = MetaNum.fromNumber(-3.14);
|
|
|
29
31
|
const c = new MetaNum("1.5e308");
|
|
30
32
|
const d = MetaNum.fromString("10^^5"); // tetration: 10^^5
|
|
31
33
|
const e = MetaNum.fromString("E100#2"); // Hyper-E: 10^10^100 (googolplex)
|
|
32
|
-
const f = MetaNum.fromString("GF^
|
|
33
|
-
const g = MetaNum.fromString("
|
|
34
|
+
const f = MetaNum.fromString("GF^2 E^3 123"); // letter notation
|
|
35
|
+
const g = MetaNum.fromString("Aa100"); // letter notation
|
|
34
36
|
const h = MetaNum.fromString("[[10], [1, 3]]"); // bracket notation
|
|
35
37
|
|
|
36
38
|
// From an array
|
|
@@ -51,17 +53,8 @@ const n = MetaNum.fromHyperE("EE100");
|
|
|
51
53
|
## Constants
|
|
52
54
|
|
|
53
55
|
```javascript
|
|
54
|
-
MetaNum.ZERO // 0
|
|
55
|
-
MetaNum.ONE // 1
|
|
56
|
-
MetaNum.TWO // 2
|
|
57
|
-
MetaNum.TEN // 10
|
|
58
|
-
MetaNum.E // Math.E
|
|
59
|
-
MetaNum.LN2 // Math.LN2
|
|
60
|
-
MetaNum.LN10 // Math.LN10
|
|
61
|
-
MetaNum.PI // π
|
|
62
|
-
MetaNum.SQRT2 // √2
|
|
63
56
|
MetaNum.MAX_SAFE_INTEGER // 9007199254740991
|
|
64
|
-
MetaNum.
|
|
57
|
+
MetaNum.E_
|
|
65
58
|
MetaNum.POSITIVE_INFINITY // Infinity
|
|
66
59
|
MetaNum.NEGATIVE_INFINITY // -Infinity
|
|
67
60
|
MetaNum.GRAHAMS_NUMBER // Graham's number (approximation)
|
|
@@ -178,61 +171,112 @@ new MetaNum(10).layeradd10(3); // 10^^3 (explicit base 10)
|
|
|
178
171
|
|
|
179
172
|
## Diagonalization / Expansion Hierarchy
|
|
180
173
|
|
|
181
|
-
These functions represent iterated diagonalizations at increasing ordinal levels
|
|
174
|
+
These functions represent iterated diagonalizations at increasing ordinal levels from ω to ε₀:
|
|
182
175
|
|
|
183
176
|
```javascript
|
|
184
177
|
const x = new MetaNum(10);
|
|
185
178
|
|
|
186
|
-
// Level
|
|
187
|
-
x.
|
|
179
|
+
// Level ω: diagonalize ω*y (→ a↑^a a)
|
|
180
|
+
x.aperiote(3); // aper(3) = h10
|
|
181
|
+
|
|
182
|
+
// Level ω+1: iterate aperiote
|
|
183
|
+
x.expande(3); // expa(3) = h11
|
|
184
|
+
|
|
185
|
+
// Level ω+2: iterate expande
|
|
186
|
+
x.multiexpande(3); // muea(3) = h12
|
|
187
|
+
|
|
188
|
+
// Level ω+3: iterate multiexpande
|
|
189
|
+
x.powerexpande(3); // poea(3) = h13
|
|
190
|
+
|
|
191
|
+
// Level ω*2: diagonalize ω+y
|
|
192
|
+
x.aperioexpande(3); // apea(3) = h20
|
|
193
|
+
|
|
194
|
+
// Level ω*2+1: iterate aperioexpande
|
|
195
|
+
x.explode(3); // expl(3) = h21
|
|
196
|
+
|
|
197
|
+
// Level ω*2+2: iterate explode
|
|
198
|
+
x.multiexplode(3); // muel(3) = h22
|
|
199
|
+
|
|
200
|
+
// Level ω*3: diagonalize ω*2+y
|
|
201
|
+
x.aperioexplode(3); // apel(3) = h30
|
|
202
|
+
|
|
203
|
+
// Level ω*3+1: iterate aperioexplode
|
|
204
|
+
x.detonate(3); // deto(3) = h31
|
|
205
|
+
|
|
206
|
+
// Level ω*4: diagonalize ω*3+y
|
|
207
|
+
x.aperiodetonate(3); // apdt(3) = h40
|
|
208
|
+
|
|
209
|
+
// Level ω^2: diagonalize ω*y
|
|
210
|
+
x.aperionate(3); // apeo(3) = h100
|
|
211
|
+
|
|
212
|
+
// Level ω^2+1: iterate aperionate
|
|
213
|
+
x.megote(3); // mego(3) = h101
|
|
188
214
|
|
|
189
|
-
// Level
|
|
190
|
-
x.
|
|
215
|
+
// Level ω^2+2: iterate megote
|
|
216
|
+
x.multimegote(3); // mume(3) = h102
|
|
191
217
|
|
|
192
|
-
// Level
|
|
193
|
-
x.
|
|
218
|
+
// Level ω^2+ω: diagonalize ω^2+y
|
|
219
|
+
x.aperimegote(3); // apmg(3) = h110
|
|
194
220
|
|
|
195
|
-
// Level
|
|
196
|
-
x.
|
|
221
|
+
// Level ω^2+ω+1: iterate aperimegote
|
|
222
|
+
x.megoexpande(3); // mgea(3) = h111
|
|
197
223
|
|
|
198
|
-
// Level
|
|
199
|
-
x.
|
|
224
|
+
// Level ω^2+ω*2: diagonalize ω^2+ω+y
|
|
225
|
+
x.aperimegoexpande(3); // apme(3) = h120
|
|
200
226
|
|
|
201
|
-
// Level
|
|
202
|
-
x.
|
|
227
|
+
// Level ω^2*2: diagonalize ω^2+ω*y
|
|
228
|
+
x.megoaperionation(3); // mgao(3) = h200
|
|
203
229
|
|
|
204
|
-
// Level ω^
|
|
205
|
-
x.
|
|
230
|
+
// Level ω^2*2+1: iterate megoaperionation
|
|
231
|
+
x.gigote(3); // gigo(3) = h201
|
|
206
232
|
|
|
207
|
-
// Level ω^
|
|
208
|
-
x.
|
|
233
|
+
// Level ω^2*2+ω: diagonalize ω^2*2+y
|
|
234
|
+
x.aperigigote(3); // apgg(3) = h210
|
|
209
235
|
|
|
210
|
-
// Level ω^
|
|
211
|
-
x.
|
|
236
|
+
// Level ω^2*3: diagonalize ω^2*2+ω*y
|
|
237
|
+
x.gigoaperionate(3); // ggap(3) = h300
|
|
212
238
|
|
|
213
|
-
// Level ω^
|
|
214
|
-
x.
|
|
239
|
+
// Level ω^3: diagonalize ω^2*y
|
|
240
|
+
x.aperiatotion(3); // apat(3) = h1000
|
|
215
241
|
|
|
216
|
-
// Level ω^
|
|
217
|
-
x.
|
|
242
|
+
// Level ω^3+1: iterate aperiatotion
|
|
243
|
+
x.powiainate(3); // pwan(3) = h1001
|
|
218
244
|
|
|
219
|
-
// Level ω^
|
|
220
|
-
x.
|
|
245
|
+
// Level ω^3+ω: diagonalize ω^3+y
|
|
246
|
+
x.expandainate(3); // epan(3) = h1010
|
|
221
247
|
|
|
222
|
-
// Level ω^
|
|
223
|
-
x.
|
|
248
|
+
// Level ω^3+ω^2: diagonalize ω^3+ω*y
|
|
249
|
+
x.megodainate(3); // mgan(3) = h1100
|
|
224
250
|
|
|
225
|
-
// Level ω^
|
|
226
|
-
x.
|
|
251
|
+
// Level ω^3*2: diagonalize ω^3+ω^2*y
|
|
252
|
+
x.powiairate(3); // pwar(3) = h2000
|
|
227
253
|
|
|
228
|
-
// Level ω^
|
|
229
|
-
x.
|
|
254
|
+
// Level ω^4: diagonalize ω^3*y
|
|
255
|
+
x.aperioguate(3); // apgu(3) = h10000
|
|
230
256
|
|
|
231
|
-
// Level ω^(
|
|
232
|
-
x.
|
|
257
|
+
// Level ω^ω: diagonalize ω^x (layer 1 transition)
|
|
258
|
+
x.iter(3); // ite(3) = hww
|
|
233
259
|
|
|
234
|
-
// Level
|
|
235
|
-
x.
|
|
260
|
+
// Level ω^ω+1: iterate ω^ω level operations
|
|
261
|
+
x.itermult(3); // itmu(3) = hw01
|
|
262
|
+
|
|
263
|
+
// Level ω^ω*2: (ω^ω)*2 = ω^ω + ω^base
|
|
264
|
+
x.cuboiter(3); // cube(3) = hwx2
|
|
265
|
+
|
|
266
|
+
// Level ω^(ω+1): ω^(ω+1) = ω^ω*ω → ω^(ω*y)
|
|
267
|
+
x.expoiter(3); // expo(3) = hwa1
|
|
268
|
+
|
|
269
|
+
// Level ω^(ω*2): ω^(ω*2) = ω^(ω+base)
|
|
270
|
+
x.trioterate(3); // tria(3) = hwm2
|
|
271
|
+
|
|
272
|
+
// Level ω^(ω^2): diagonalize ω^(ω*y) (layer 2)
|
|
273
|
+
x.trixxate(3); // trix(3) = hwp2
|
|
274
|
+
|
|
275
|
+
// Level ω^(ω^ω): diagonalize ω^(ω^y) (layer 3)
|
|
276
|
+
x.aperixxate(3); // apix(3) = hwpw
|
|
277
|
+
|
|
278
|
+
// Level ε₀ = ω↑↑ω: diagonalize ω↑↑y (layer 4)
|
|
279
|
+
x.epsilonate(3); // epsl(3) = hepsl
|
|
236
280
|
```
|
|
237
281
|
|
|
238
282
|
## Inverse Operations
|
|
@@ -240,24 +284,68 @@ x.iter(3); // iter(x, 3)
|
|
|
240
284
|
Each expansion operation has a corresponding inverse for decrementing ordinal structure:
|
|
241
285
|
|
|
242
286
|
```javascript
|
|
243
|
-
x.i_aper(z) // inverse of
|
|
244
|
-
x.i_expa(z) // inverse of expande
|
|
245
|
-
x.i_muea(z) // inverse of multiexpande
|
|
246
|
-
x.i_poea(z) // inverse of powerexpande
|
|
247
|
-
x.i_apea(z) // inverse of
|
|
248
|
-
x.i_expl(z) // inverse of explode
|
|
249
|
-
x.i_muel(z) // inverse of multiexplode
|
|
250
|
-
x.i_apel(z) // inverse of aperioexplode
|
|
251
|
-
x.i_deto(z) // inverse of detonate
|
|
252
|
-
x.
|
|
253
|
-
x.
|
|
254
|
-
x.
|
|
255
|
-
x.
|
|
256
|
-
x.
|
|
257
|
-
x.
|
|
258
|
-
x.
|
|
259
|
-
x.
|
|
260
|
-
x.
|
|
287
|
+
x.i_aper(z) // i10 = inverse of aperiote
|
|
288
|
+
x.i_expa(z) // i11 = inverse of expande
|
|
289
|
+
x.i_muea(z) // i12 = inverse of multiexpande
|
|
290
|
+
x.i_poea(z) // i13 = inverse of powerexpande
|
|
291
|
+
x.i_apea(z) // i20 = inverse of aperioexpande
|
|
292
|
+
x.i_expl(z) // i21 = inverse of explode
|
|
293
|
+
x.i_muel(z) // i22 = inverse of multiexplode
|
|
294
|
+
x.i_apel(z) // i30 = inverse of aperioexplode
|
|
295
|
+
x.i_deto(z) // i31 = inverse of detonate
|
|
296
|
+
x.i_apdt(z) // i40 = inverse of aperiodetonate
|
|
297
|
+
x.i_apeo(z) // i100 = inverse of aperionate
|
|
298
|
+
x.i_mego(z) // i101 = inverse of megote
|
|
299
|
+
x.i_mume(z) // i102 = inverse of multimegote
|
|
300
|
+
x.i_apmg(z) // i110 = inverse of aperimegote
|
|
301
|
+
x.i_mgea(z) // i111 = inverse of megoexpande
|
|
302
|
+
x.i_apme(z) // i120 = inverse of aperimegoexpande
|
|
303
|
+
x.i_mgao(z) // i200 = inverse of megoaperionation
|
|
304
|
+
x.i_gigo(z) // i201 = inverse of gigote
|
|
305
|
+
x.i_apgg(z) // i210 = inverse of aperigigote
|
|
306
|
+
x.i_ggap(z) // i300 = inverse of gigoaperionate
|
|
307
|
+
x.i_apat(z) // i1000 = inverse of aperiatotion
|
|
308
|
+
x.i_pwan(z) // i1001 = inverse of powiainate
|
|
309
|
+
x.i_epan(z) // i1010 = inverse of expandainate
|
|
310
|
+
x.i_mgan(z) // i1100 = inverse of megodainate
|
|
311
|
+
x.i_pwar(z) // i2000 = inverse of powiairate
|
|
312
|
+
x.i_apgu(z) // i10000 = inverse of aperioguate
|
|
313
|
+
x.i_ite(z) // iww = inverse of iter
|
|
314
|
+
x.i_itmu(z) // iw01 = inverse of itermult
|
|
315
|
+
x.i_cube(z) // iwx2 = inverse of cuboiter
|
|
316
|
+
x.i_expo(z) // iwa1 = inverse of expoiter
|
|
317
|
+
x.i_tria(z) // iwm2 = inverse of trioterate
|
|
318
|
+
x.i_trix(z) // iwp2 = inverse of trixxate
|
|
319
|
+
x.i_apix(z) // iwpw = inverse of aperixxate
|
|
320
|
+
x.i_epsl(z) // iepsl = inverse of epsilonate
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## BEAF Operations
|
|
324
|
+
|
|
325
|
+
Bowers' Exploding Array Function (BEAF) is supported via ordinal arithmetic for 4+ arguments:
|
|
326
|
+
|
|
327
|
+
```javascript
|
|
328
|
+
// 3-entry: {a,b,c} = a↑^c b (standard up-arrow notation)
|
|
329
|
+
MetaNum.BEAF(3, 3, 2); // 3↑↑3 = 7625597484987
|
|
330
|
+
MetaNum.BEAF(3, 3, 3); // 3↑↑↑3 = tritri
|
|
331
|
+
|
|
332
|
+
// 4-entry: {a,b,c,d} = a(ω*(d-1)+(c-1) level operation)b
|
|
333
|
+
MetaNum.BEAF(2, 2, 1, 2); // = 4
|
|
334
|
+
MetaNum.BEAF(3, 3, 3, 3); // 3(ω*2+2 level operation)3
|
|
335
|
+
|
|
336
|
+
// 5+ entry: ordinal arithmetic
|
|
337
|
+
// BEAF(a,b,c,d,...,n) = a(ω^(n-3)*(arg_n-1)+...+ω*(d-1)+(c-1) level operation)b
|
|
338
|
+
MetaNum.BEAF(10, 2, 1, 1, 2); // = BEAF(10,10,10,10) (ω^2 level operation)
|
|
339
|
+
MetaNum.BEAF(3, 3, 3, 3, 2); // 3(ω^2+ω*2+2 level operation)3
|
|
340
|
+
|
|
341
|
+
// Parse BEAF string notation
|
|
342
|
+
MetaNum.fromBeaf("{3,3,3}"); // 3↑↑↑3
|
|
343
|
+
MetaNum.fromBeaf("{3,3,3,3}"); // 3(ω*2+2)3
|
|
344
|
+
MetaNum.fromBeaf("{10,2,1,1,2}"); // 10(ω^2)2
|
|
345
|
+
|
|
346
|
+
// Convert to BEAF string
|
|
347
|
+
new MetaNum(7625597484987).toBeaf(); // "{7625597484987}"
|
|
348
|
+
MetaNum.BEAF(3,3,3).toBeaf(); // "{3638334640023.7783}"
|
|
261
349
|
```
|
|
262
350
|
|
|
263
351
|
## Layer & Serialization
|
|
@@ -561,8 +649,6 @@ The Definiton of more symbols is similar to the definition of @Aa.
|
|
|
561
649
|
|
|
562
650
|
$Aa \~ f\_ω^ω^ω^ω^ω\_(10)
|
|
563
651
|
|
|
564
|
-
And there are more symbols : % & \~ < > ? and symbol combinations like !!, !@, !#, @!.
|
|
565
|
-
|
|
566
652
|
Then we can define (the β-th symbol or symbol combination)Aa = f\_ω^ω^...^ω(β+1 ω's)\_(10)
|
|
567
653
|
|
|
568
654
|
### Definition of the final letter: ε
|
|
@@ -573,8 +659,10 @@ Then we can define (the β-th symbol or symbol combination)Aa = f\_ω^ω^...^ω(
|
|
|
573
659
|
|
|
574
660
|
#### Using dlsdl's letter notation, the biggest number we can define in Metanum is about ε1.797e308.
|
|
575
661
|
|
|
576
|
-
##
|
|
662
|
+
## Changelog
|
|
577
663
|
|
|
664
|
+
- 2026-7-9 v1.2 Add more hyper operations up to ε₀, add BEAF operation and fix bugs
|
|
665
|
+
- 2026-6-3 v1.1 Add support for very small numbers ,add more hyper operations and fix bugs
|
|
578
666
|
- 2026-5-23 v1.0 Rewritten and add even more hyper operations
|
|
579
667
|
- 2026-2-24 v0.4 Add hyper operations and extend fromString
|
|
580
668
|
- 2026-2-11 v0.3 Reconstruct code and correct calculating functions
|