eliscript 0.1.0 → 0.1.1
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 +9 -8
- package/bootstrap/compiler/emitter.eli +161 -63
- package/bootstrap/host/check-cli.mjs +0 -1
- package/bootstrap/host/check-cli.mjs.map +1 -1
- package/bootstrap/host/compiler-session.eli +2 -1
- package/bootstrap/host/eliscript-cli.mjs +2 -9
- package/bootstrap/host/eliscript-cli.mjs.map +1 -1
- package/bootstrap/host/project-cli.mjs +1 -11
- package/bootstrap/host/project-cli.mjs.map +1 -1
- package/bootstrap/host/project.mjs +2 -8
- package/bootstrap/host/project.mjs.map +1 -1
- package/browser/README.md +1 -1
- package/compiler/README.md +2 -2
- package/compiler/eliscript-emitter.el +229 -85
- package/compiler/eliscript-ir-emitter.el +64 -34
- package/compiler/eliscript-project.el +20 -5
- package/dist/backends/async.mjs +1 -90
- package/dist/backends/async.mjs.map +1 -1
- package/dist/backends/binary.mjs +1 -91
- package/dist/backends/binary.mjs.map +1 -1
- package/dist/backends/capabilities.mjs +1 -90
- package/dist/backends/capabilities.mjs.map +1 -1
- package/dist/backends/elf.mjs +1 -90
- package/dist/backends/elf.mjs.map +1 -1
- package/dist/backends/managed.mjs +1 -94
- package/dist/backends/managed.mjs.map +1 -1
- package/dist/backends/memory.mjs +1 -90
- package/dist/backends/memory.mjs.map +1 -1
- package/dist/backends/native.mjs +1 -91
- package/dist/backends/native.mjs.map +1 -1
- package/dist/backends/numeric.mjs +1 -90
- package/dist/backends/numeric.mjs.map +1 -1
- package/dist/backends/optimize.mjs +1 -90
- package/dist/backends/optimize.mjs.map +1 -1
- package/dist/backends/regexp.mjs +1 -91
- package/dist/backends/regexp.mjs.map +1 -1
- package/dist/backends/sha256.mjs +2 -96
- package/dist/backends/sha256.mjs.map +1 -1
- package/dist/backends/wasm.mjs +1 -90
- package/dist/backends/wasm.mjs.map +1 -1
- package/dist/bootstrap/analyzer.mjs +1 -95
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +1 -105
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +848 -807
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +1 -96
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/formatter.mjs +1 -104
- package/dist/bootstrap/formatter.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +18 -172
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/lower.mjs +1 -92
- package/dist/bootstrap/lower.mjs.map +1 -1
- package/dist/bootstrap/project.mjs +23 -209
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +1 -96
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/source-map.mjs +7 -112
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/symbol.mjs +7 -114
- package/dist/bootstrap/symbol.mjs.map +1 -1
- package/dist/bootstrap/syntax.mjs +10 -176
- package/dist/bootstrap/syntax.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +1 -93
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +105 -104
- package/dist/browser/loader.js +1 -1
- package/dist/browser/loader.mjs +5 -124
- package/dist/compiler-artifact.json +1 -1
- package/dist/host/compiler-session.mjs +205 -297
- package/dist/host/compiler-session.mjs.map +1 -1
- package/dist/host/compiler-tools.mjs +1 -91
- package/dist/host/compiler-tools.mjs.map +1 -1
- package/dist/literal-sources/runtime/core/order.eli +32 -10
- package/dist/literal-sources/runtime/core/sequence.eli +69 -28
- package/dist/literal-sources/runtime/core/vector.eli +2 -4
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +5 -5
- package/dist/literal-sources/stdlib/managed-literals.eli +1 -1
- package/dist/package.json +1 -0
- package/dist/runtime/math.mjs +62 -252
- package/dist/runtime/math.mjs.map +1 -1
- package/dist/runtime/prelude.mjs +95 -0
- package/dist/runtime/prelude.mjs.macro-origins.json +1 -0
- package/dist/runtime/prelude.mjs.map +1 -0
- package/dist/runtime/unicode-case-data.mjs +1 -95
- package/dist/runtime/unicode-case-data.mjs.map +1 -1
- package/dist/runtime/unicode-case.mjs +3 -97
- package/dist/runtime/unicode-case.mjs.map +1 -1
- package/dist/stage3-release.json +1 -1
- package/editor/README.md +9 -4
- package/editor/eliscript-compat.el +164 -2
- package/editor/eliscript-mode.el +1 -1
- package/editor/eliscript-repl.el +1 -1
- package/package.json +2 -1
- package/runtime/README.md +21 -1
- package/runtime/core/protocol-impl.mjs +1 -115
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/text-impl.mjs +1 -90
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/vector.eli +1 -1
- package/runtime/core/vector.mjs +0 -9
- package/runtime/emacs-compat.eli +5957 -2
- package/runtime/emacs-compat.mjs +13522 -2295
- package/runtime/emacs-compat.mjs.map +1 -0
- package/runtime/math.mjs +62 -252
- package/runtime/math.mjs.map +1 -1
- package/runtime/prelude.eli +4 -0
- package/runtime/prelude.mjs +95 -0
- package/runtime/prelude.mjs.map +1 -0
- package/runtime/unicode-case-data.mjs +1 -95
- package/runtime/unicode-case-data.mjs.map +1 -1
- package/runtime/unicode-case.mjs +3 -97
- package/runtime/unicode-case.mjs.map +1 -1
- package/stdlib/managed-literals.eli +1 -1
- package/stdlib/managed-runtime-vector.eli +2 -4
- package/tools/backends/compiler-build.mjs +3 -93
- package/tools/backends/compiler-cli.mjs +2 -15
- package/tools/backends/compiler-corpus-bit.mjs +2 -95
- package/tools/backends/compiler-corpus-cli-adapters.mjs +1 -97
- package/tools/backends/compiler-corpus-debugging.mjs +2 -95
- package/tools/backends/compiler-corpus-emitter.mjs +1 -97
- package/tools/backends/compiler-corpus-execution.mjs +2 -108
- package/tools/backends/compiler-corpus-fuzz.mjs +2 -95
- package/tools/backends/compiler-corpus-host-context.mjs +2 -99
- package/tools/backends/compiler-corpus-identity-host.mjs +18 -123
- package/tools/backends/compiler-corpus-identity-value-adapters.mjs +0 -9
- package/tools/backends/compiler-corpus-literal-provider.mjs +1 -91
- package/tools/backends/compiler-corpus-managed-adapters.mjs +1 -99
- package/tools/backends/compiler-corpus-managed-fixtures.mjs +2 -113
- package/tools/backends/compiler-corpus-matchers.mjs +3 -106
- package/tools/backends/compiler-corpus-original-program.mjs +1 -91
- package/tools/backends/compiler-corpus-process.mjs +1 -92
- package/tools/backends/compiler-corpus-program-driver.mjs +1 -3
- package/tools/backends/compiler-corpus-project-adapters.mjs +1 -95
- package/tools/backends/compiler-corpus-project-entry-host.mjs +2 -92
- package/tools/backends/compiler-corpus-project-transport.mjs +1 -90
- package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1 -91
- package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1 -92
- package/tools/backends/compiler-corpus-raw-math-fixture.mjs +1 -91
- package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +1 -91
- package/tools/backends/compiler-corpus-reference.mjs +1 -90
- package/tools/backends/compiler-corpus-runtime-adapters.mjs +2 -110
- package/tools/backends/compiler-corpus-tools-cli.mjs +1 -95
- package/tools/backends/compiler-corpus-tools-reference.mjs +22 -163
- package/tools/backends/compiler-corpus.mjs +3 -125
- package/tools/backends/compiler-matrix.mjs +1 -92
- package/tools/backends/compiler-package-browser.mjs +1 -90
- package/tools/backends/compiler-package.mjs +3 -95
- package/tools/backends/compiler-unicode-profile-host.mjs +1 -91
- package/tools/backends/dist/bootstrap-js-stages.mjs +1 -91
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs +1 -91
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
- package/tools/backends/dist/record-grid.mjs +1 -91
- package/tools/backends/dist/record-grid.mjs.map +1 -1
- package/tools/backends/dist/release-cli.mjs +4 -94
- package/tools/backends/dist/release-cli.mjs.map +1 -1
- package/tools/backends/dist/run-artifact.mjs +1 -91
- package/tools/backends/dist/run-artifact.mjs.map +1 -1
- package/tools/backends/eliscript/compiler-corpus-bit.eli +1 -0
- package/tools/backends/managed-foreign-binding.mjs +1 -95
- package/tools/backends/managed-host-lifecycle.mjs +1 -91
- package/tools/backends/managed-host-object-provider.mjs +18 -59
- package/tools/backends/managed-host-object-realm.mjs +1 -91
- package/tools/backends/managed-host-proxy.mjs +9 -18
- package/tools/backends/managed-host-runtime.mjs +3 -105
- package/tools/backends/managed-host.mjs +1 -104
- package/tools/backends/managed-module-graph.mjs +1 -97
- package/tools/backends/managed-runtime.mjs +1 -96
- package/tools/backends/managed-source-view.mjs +13 -108
- package/tools/backends/native-managed-runtime.mjs +1 -91
- package/tools/backends/native-memory.mjs +1 -91
- package/tools/backends/stage3-targets.mjs +1 -91
- package/tools/bootstrap-runtime.el +3 -2
- package/tools/project/project.eli +1 -1
- package/tools/testing/stdlib-bit-corpus-host.mjs +1 -90
- package/tools/testing/stdlib-bit.mjs +1 -90
- package/dist/bootstrap/package.json +0 -1
- package/dist/bootstrap/runtime/math.mjs +0 -1117
- package/dist/bootstrap/runtime/math.mjs.map +0 -1
- package/dist/bootstrap/runtime/unicode-case-data.mjs +0 -10125
- package/dist/bootstrap/runtime/unicode-case-data.mjs.map +0 -1
- package/dist/bootstrap/runtime/unicode-case.mjs +0 -281
- package/dist/bootstrap/runtime/unicode-case.mjs.map +0 -1
package/dist/runtime/math.mjs
CHANGED
|
@@ -1,236 +1,50 @@
|
|
|
1
1
|
// Generated by Eliscript. Do not edit.
|
|
2
|
-
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
|
-
var __eliscript_tdz_ready_0;
|
|
4
|
-
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("namespace"); return namespace; }
|
|
5
|
-
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("namespace"); return __eliscript_const_error(); }
|
|
6
|
-
var __eliscript_tdz_ready_1;
|
|
7
|
-
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("apply_native"); return apply_native; }
|
|
8
|
-
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("apply_native"); return __eliscript_const_error(); }
|
|
9
|
-
var __eliscript_tdz_ready_2;
|
|
10
|
-
function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("define_native"); return define_native; }
|
|
11
|
-
function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("define_native"); return __eliscript_const_error(); }
|
|
12
|
-
var __eliscript_tdz_ready_3;
|
|
13
|
-
function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("same_native"); return same_native; }
|
|
14
|
-
function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("same_native"); return __eliscript_const_error(); }
|
|
15
|
-
var __eliscript_tdz_ready_4;
|
|
16
|
-
function __eliscript_tdz_read_4() { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("object_native"); return object_native; }
|
|
17
|
-
function __eliscript_tdz_write_4(__eliscript_tdz_value_4) { if (__eliscript_tdz_ready_4 !== true) __eliscript_tdz_error("object_native"); return __eliscript_const_error(); }
|
|
18
|
-
var __eliscript_tdz_ready_5;
|
|
19
|
-
function __eliscript_tdz_read_5() { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("boolean_native"); return boolean_native; }
|
|
20
|
-
function __eliscript_tdz_write_5(__eliscript_tdz_value_5) { if (__eliscript_tdz_ready_5 !== true) __eliscript_tdz_error("boolean_native"); return __eliscript_const_error(); }
|
|
21
|
-
var __eliscript_tdz_ready_6;
|
|
22
|
-
function __eliscript_tdz_read_6() { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("finite_native"); return finite_native; }
|
|
23
|
-
function __eliscript_tdz_write_6(__eliscript_tdz_value_6) { if (__eliscript_tdz_ready_6 !== true) __eliscript_tdz_error("finite_native"); return __eliscript_const_error(); }
|
|
24
|
-
var __eliscript_tdz_ready_7;
|
|
25
|
-
function __eliscript_tdz_read_7() { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("nan_native"); return nan_native; }
|
|
26
|
-
function __eliscript_tdz_write_7(__eliscript_tdz_value_7) { if (__eliscript_tdz_ready_7 !== true) __eliscript_tdz_error("nan_native"); return __eliscript_const_error(); }
|
|
27
|
-
var __eliscript_tdz_ready_8;
|
|
28
|
-
function __eliscript_tdz_read_8() { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("floor_native"); return floor_native; }
|
|
29
|
-
function __eliscript_tdz_write_8(__eliscript_tdz_value_8) { if (__eliscript_tdz_ready_8 !== true) __eliscript_tdz_error("floor_native"); return __eliscript_const_error(); }
|
|
30
|
-
var __eliscript_tdz_ready_9;
|
|
31
|
-
function __eliscript_tdz_read_9() { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("power_native"); return power_native; }
|
|
32
|
-
function __eliscript_tdz_write_9(__eliscript_tdz_value_9) { if (__eliscript_tdz_ready_9 !== true) __eliscript_tdz_error("power_native"); return __eliscript_const_error(); }
|
|
33
|
-
var __eliscript_tdz_ready_10;
|
|
34
|
-
function __eliscript_tdz_read_10() { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("sqrt_native"); return sqrt_native; }
|
|
35
|
-
function __eliscript_tdz_write_10(__eliscript_tdz_value_10) { if (__eliscript_tdz_ready_10 !== true) __eliscript_tdz_error("sqrt_native"); return __eliscript_const_error(); }
|
|
36
|
-
var __eliscript_tdz_ready_11;
|
|
37
|
-
function __eliscript_tdz_read_11() { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("numbers_constructor"); return numbers_constructor; }
|
|
38
|
-
function __eliscript_tdz_write_11(__eliscript_tdz_value_11) { if (__eliscript_tdz_ready_11 !== true) __eliscript_tdz_error("numbers_constructor"); return __eliscript_const_error(); }
|
|
39
|
-
var __eliscript_tdz_ready_12;
|
|
40
|
-
function __eliscript_tdz_read_12() { if (__eliscript_tdz_ready_12 !== true) __eliscript_tdz_error("type_error_native"); return type_error_native; }
|
|
41
|
-
function __eliscript_tdz_write_12(__eliscript_tdz_value_12) { if (__eliscript_tdz_ready_12 !== true) __eliscript_tdz_error("type_error_native"); return __eliscript_const_error(); }
|
|
42
|
-
var __eliscript_tdz_ready_13;
|
|
43
|
-
function __eliscript_tdz_read_13() { if (__eliscript_tdz_ready_13 !== true) __eliscript_tdz_error("range_error_native"); return range_error_native; }
|
|
44
|
-
function __eliscript_tdz_write_13(__eliscript_tdz_value_13) { if (__eliscript_tdz_ready_13 !== true) __eliscript_tdz_error("range_error_native"); return __eliscript_const_error(); }
|
|
45
|
-
var __eliscript_tdz_ready_14;
|
|
46
|
-
function __eliscript_tdz_read_14() { if (__eliscript_tdz_ready_14 !== true) __eliscript_tdz_error("iterator_key"); return iterator_key; }
|
|
47
|
-
function __eliscript_tdz_write_14(__eliscript_tdz_value_14) { if (__eliscript_tdz_ready_14 !== true) __eliscript_tdz_error("iterator_key"); return __eliscript_const_error(); }
|
|
48
|
-
var __eliscript_tdz_ready_15;
|
|
49
|
-
function __eliscript_tdz_read_15() { if (__eliscript_tdz_ready_15 !== true) __eliscript_tdz_error("words_constructor"); return words_constructor; }
|
|
50
|
-
function __eliscript_tdz_write_15(__eliscript_tdz_value_15) { if (__eliscript_tdz_ready_15 !== true) __eliscript_tdz_error("words_constructor"); return __eliscript_const_error(); }
|
|
51
|
-
var __eliscript_tdz_ready_16;
|
|
52
|
-
function __eliscript_tdz_read_16() { if (__eliscript_tdz_ready_16 !== true) __eliscript_tdz_error("view"); return view; }
|
|
53
|
-
function __eliscript_tdz_write_16(__eliscript_tdz_value_16) { if (__eliscript_tdz_ready_16 !== true) __eliscript_tdz_error("view"); return __eliscript_const_error(); }
|
|
54
|
-
var __eliscript_tdz_ready_17;
|
|
55
|
-
function __eliscript_tdz_read_17() { if (__eliscript_tdz_ready_17 !== true) __eliscript_tdz_error("get_word"); return get_word; }
|
|
56
|
-
function __eliscript_tdz_write_17(__eliscript_tdz_value_17) { if (__eliscript_tdz_ready_17 !== true) __eliscript_tdz_error("get_word"); return __eliscript_const_error(); }
|
|
57
|
-
var __eliscript_tdz_ready_18;
|
|
58
|
-
function __eliscript_tdz_read_18() { if (__eliscript_tdz_ready_18 !== true) __eliscript_tdz_error("set_word"); return set_word; }
|
|
59
|
-
function __eliscript_tdz_write_18(__eliscript_tdz_value_18) { if (__eliscript_tdz_ready_18 !== true) __eliscript_tdz_error("set_word"); return __eliscript_const_error(); }
|
|
60
|
-
var __eliscript_tdz_ready_19;
|
|
61
|
-
function __eliscript_tdz_read_19() { if (__eliscript_tdz_ready_19 !== true) __eliscript_tdz_error("get_number"); return get_number; }
|
|
62
|
-
function __eliscript_tdz_write_19(__eliscript_tdz_value_19) { if (__eliscript_tdz_ready_19 !== true) __eliscript_tdz_error("get_number"); return __eliscript_const_error(); }
|
|
63
|
-
var __eliscript_tdz_ready_20;
|
|
64
|
-
function __eliscript_tdz_read_20() { if (__eliscript_tdz_ready_20 !== true) __eliscript_tdz_error("set_number"); return set_number; }
|
|
65
|
-
function __eliscript_tdz_write_20(__eliscript_tdz_value_20) { if (__eliscript_tdz_ready_20 !== true) __eliscript_tdz_error("set_number"); return __eliscript_const_error(); }
|
|
66
|
-
var __eliscript_tdz_ready_21;
|
|
67
|
-
function __eliscript_tdz_read_21() { if (__eliscript_tdz_ready_21 !== true) __eliscript_tdz_error("f16round"); return f16round; }
|
|
68
|
-
function __eliscript_tdz_write_21(__eliscript_tdz_value_21) { if (__eliscript_tdz_ready_21 !== true) __eliscript_tdz_error("f16round"); return __eliscript_const_error(); }
|
|
69
|
-
var __eliscript_tdz_ready_22;
|
|
70
|
-
function __eliscript_tdz_read_22() { if (__eliscript_tdz_ready_22 !== true) __eliscript_tdz_error("sumPrecise"); return sumPrecise; }
|
|
71
|
-
function __eliscript_tdz_write_22(__eliscript_tdz_value_22) { if (__eliscript_tdz_ready_22 !== true) __eliscript_tdz_error("sumPrecise"); return __eliscript_const_error(); }
|
|
72
|
-
var __eliscript_tdz_ready_23;
|
|
73
|
-
function __eliscript_tdz_read_23() { if (__eliscript_tdz_ready_23 !== true) __eliscript_tdz_error("hypot"); return hypot; }
|
|
74
|
-
function __eliscript_tdz_write_23(__eliscript_tdz_value_23) { if (__eliscript_tdz_ready_23 !== true) __eliscript_tdz_error("hypot"); return __eliscript_const_error(); }
|
|
75
|
-
var __eliscript_tdz_ready_24;
|
|
76
|
-
function __eliscript_tdz_read_24() { if (__eliscript_tdz_ready_24 !== true) __eliscript_tdz_error("pow"); return pow; }
|
|
77
|
-
function __eliscript_tdz_write_24(__eliscript_tdz_value_24) { if (__eliscript_tdz_ready_24 !== true) __eliscript_tdz_error("pow"); return __eliscript_const_error(); }
|
|
78
2
|
import "eliscript/runtime/unicode-case.mjs";
|
|
3
|
+
import { __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numeric_relation, __eliscript_numeric_sub, __eliscript_numeric_mul, __eliscript_numeric_div, __eliscript_numeric_rem, __eliscript_numeric_and, __eliscript_numeric_or, __eliscript_numeric_xor, __eliscript_numeric_shl, __eliscript_numeric_shr, __eliscript_numeric_ushr, __eliscript_numeric_neg, __eliscript_numeric_int32, __eliscript_numeric_uint32, __eliscript_numeric_not } from "eliscript/runtime/prelude.mjs";
|
|
79
4
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
80
|
-
const __eliscript_number_intrinsic = globalThis.Number;
|
|
81
|
-
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
82
|
-
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
83
|
-
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
84
|
-
const __eliscript_numeric_error = globalThis.TypeError;
|
|
85
|
-
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
86
|
-
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
87
|
-
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
88
|
-
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
89
|
-
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
90
|
-
const __eliscript_numeric_primitive = (value) => {
|
|
91
|
-
if (!__eliscript_numeric_object(value)) return value;
|
|
92
|
-
const exotic = value[__eliscript_numeric_symbol];
|
|
93
|
-
if (exotic !== void 0 && exotic !== null) {
|
|
94
|
-
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
95
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
96
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
97
|
-
}
|
|
98
|
-
for (let index = 0; index < 2; index++) {
|
|
99
|
-
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
100
|
-
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
101
|
-
const result = __eliscript_numeric_apply(method, value, []);
|
|
102
|
-
if (!__eliscript_numeric_object(result)) return result;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
106
|
-
};
|
|
107
|
-
const __eliscript_to_number = (value) => {
|
|
108
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
109
|
-
if (typeof primitive === "string") {
|
|
110
|
-
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
111
|
-
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
112
|
-
let first = 2;
|
|
113
|
-
while (first < text.length && text[first] === "0") first++;
|
|
114
|
-
if (first === text.length) return 0;
|
|
115
|
-
const prefix = text[1];
|
|
116
|
-
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
117
|
-
if (text.length - first > limit) return 1 / 0;
|
|
118
|
-
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
119
|
-
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return __eliscript_number_intrinsic(primitive);
|
|
123
|
-
};
|
|
124
|
-
const __eliscript_numeric = (value) => {
|
|
125
|
-
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
126
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
127
|
-
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
128
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
129
|
-
};
|
|
130
|
-
const __eliscript_implicit_number = (value) => {
|
|
131
|
-
if (typeof value === "number") return value;
|
|
132
|
-
const primitive = __eliscript_numeric_primitive(value);
|
|
133
|
-
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
134
|
-
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
135
|
-
};
|
|
136
|
-
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
137
|
-
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
138
|
-
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
139
|
-
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
140
|
-
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
141
|
-
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
142
|
-
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
143
|
-
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
144
|
-
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
145
|
-
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
146
|
-
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
147
|
-
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
148
|
-
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
149
|
-
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
150
|
-
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
151
|
-
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
152
|
-
if (typeof left === "number" && typeof right === "number") {
|
|
153
|
-
if (operator === "<") return left < right;
|
|
154
|
-
if (operator === "<=") return left <= right;
|
|
155
|
-
if (operator === ">") return left > right;
|
|
156
|
-
return left >= right;
|
|
157
|
-
}
|
|
158
|
-
let a = __eliscript_numeric_primitive(left);
|
|
159
|
-
let b = __eliscript_numeric_primitive(right);
|
|
160
|
-
const x = typeof a, y = typeof b;
|
|
161
|
-
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
162
|
-
a = __eliscript_numeric(a);
|
|
163
|
-
b = __eliscript_numeric(b);
|
|
164
|
-
}
|
|
165
|
-
if (operator === "<") return a < b;
|
|
166
|
-
if (operator === "<=") return a <= b;
|
|
167
|
-
if (operator === ">") return a > b;
|
|
168
|
-
return a >= b;
|
|
169
|
-
};
|
|
170
5
|
|
|
171
6
|
const namespace = Reflect.get(globalThis.globalThis, "Math");
|
|
172
|
-
__eliscript_tdz_ready_0 = true;
|
|
173
7
|
const apply_native = Reflect.apply;
|
|
174
|
-
__eliscript_tdz_ready_1 = true;
|
|
175
8
|
const define_native = Object.defineProperty;
|
|
176
|
-
__eliscript_tdz_ready_2 = true;
|
|
177
9
|
const same_native = Object.is;
|
|
178
|
-
__eliscript_tdz_ready_3 = true;
|
|
179
10
|
const object_native = globalThis.Object;
|
|
180
|
-
__eliscript_tdz_ready_4 = true;
|
|
181
11
|
const boolean_native = globalThis.Boolean;
|
|
182
|
-
__eliscript_tdz_ready_5 = true;
|
|
183
12
|
const finite_native = Number.isFinite;
|
|
184
|
-
__eliscript_tdz_ready_6 = true;
|
|
185
13
|
const nan_native = Number.isNaN;
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
const power_native = ((__eliscript_tdz_read_0()))["pow"];
|
|
190
|
-
__eliscript_tdz_ready_9 = true;
|
|
191
|
-
const sqrt_native = ((__eliscript_tdz_read_0()))["sqrt"];
|
|
192
|
-
__eliscript_tdz_ready_10 = true;
|
|
14
|
+
const floor_native = (namespace)["floor"];
|
|
15
|
+
const power_native = (namespace)["pow"];
|
|
16
|
+
const sqrt_native = (namespace)["sqrt"];
|
|
193
17
|
const numbers_constructor = globalThis.Float64Array;
|
|
194
|
-
__eliscript_tdz_ready_11 = true;
|
|
195
18
|
const type_error_native = globalThis.TypeError;
|
|
196
|
-
__eliscript_tdz_ready_12 = true;
|
|
197
19
|
const range_error_native = globalThis.RangeError;
|
|
198
|
-
__eliscript_tdz_ready_13 = true;
|
|
199
20
|
const iterator_key = globalThis.Symbol.iterator;
|
|
200
|
-
__eliscript_tdz_ready_14 = true;
|
|
201
21
|
const words_constructor = globalThis.Uint32Array;
|
|
202
|
-
__eliscript_tdz_ready_15 = true;
|
|
203
22
|
const view = new (globalThis.DataView)(new (globalThis.ArrayBuffer)(8));
|
|
204
|
-
__eliscript_tdz_ready_16 = true;
|
|
205
23
|
const get_word = (globalThis.DataView.prototype)["getUint32"];
|
|
206
|
-
__eliscript_tdz_ready_17 = true;
|
|
207
24
|
const set_word = (globalThis.DataView.prototype)["setUint32"];
|
|
208
|
-
__eliscript_tdz_ready_18 = true;
|
|
209
25
|
const get_number = (globalThis.DataView.prototype)["getFloat64"];
|
|
210
|
-
__eliscript_tdz_ready_19 = true;
|
|
211
26
|
const set_number = (globalThis.DataView.prototype)["setFloat64"];
|
|
212
|
-
__eliscript_tdz_ready_20 = true;
|
|
213
27
|
function word_at(offset) {
|
|
214
|
-
return (
|
|
28
|
+
return apply_native(get_word, view, [offset, true]);
|
|
215
29
|
}
|
|
216
30
|
function number_from_words(low, high) {
|
|
217
|
-
(
|
|
218
|
-
(
|
|
219
|
-
return (
|
|
31
|
+
apply_native(set_word, view, [0, low, true]);
|
|
32
|
+
apply_native(set_word, view, [4, high, true]);
|
|
33
|
+
return apply_native(get_number, view, [0, true]);
|
|
220
34
|
}
|
|
221
35
|
function round_significand(significand, shift) {
|
|
222
36
|
{
|
|
223
|
-
let divisor = (
|
|
224
|
-
let quotient = (
|
|
37
|
+
let divisor = power_native(2, shift);
|
|
38
|
+
let quotient = floor_native(__eliscript_numeric_div(significand, divisor));
|
|
225
39
|
let remainder = __eliscript_numeric_sub(significand, __eliscript_numeric_mul(quotient, divisor));
|
|
226
40
|
let half = __eliscript_numeric_div(divisor, 2);
|
|
227
41
|
return (quotient + ((__eliscript_numeric_relation(">", remainder, half) || ((remainder === half) && (__eliscript_numeric_rem(quotient, 2) === 1))) ? 1 : 0));
|
|
228
42
|
}
|
|
229
43
|
}
|
|
230
44
|
const f16round = ((input) => {
|
|
231
|
-
(
|
|
45
|
+
apply_native(set_number, view, [0, input, true]);
|
|
232
46
|
{
|
|
233
|
-
let number = (
|
|
47
|
+
let number = apply_native(get_number, view, [0, true]);
|
|
234
48
|
let low = word_at(0);
|
|
235
49
|
let high = word_at(4);
|
|
236
50
|
let negative = ((__eliscript_value_1, __eliscript_value_2) => (__eliscript_value_1 !== __eliscript_value_2))(__eliscript_numeric_and(high, 2147483648), 0);
|
|
@@ -274,7 +88,7 @@ const f16round = ((input) => {
|
|
|
274
88
|
}
|
|
275
89
|
}
|
|
276
90
|
{
|
|
277
|
-
const __eliscript_value_7 = ((half_exponent === 31) ? globalThis.Infinity : ((half_exponent === 0) ? __eliscript_numeric_mul(half_fraction, (
|
|
91
|
+
const __eliscript_value_7 = ((half_exponent === 31) ? globalThis.Infinity : ((half_exponent === 0) ? __eliscript_numeric_mul(half_fraction, power_native(2, -24)) : __eliscript_numeric_mul((1024 + half_fraction), power_native(2, __eliscript_numeric_sub(half_exponent, 25)))));
|
|
278
92
|
{
|
|
279
93
|
let magnitude = __eliscript_value_7;
|
|
280
94
|
if (__eliscript_truthy(negative)) {
|
|
@@ -289,7 +103,6 @@ const f16round = ((input) => {
|
|
|
289
103
|
}
|
|
290
104
|
}
|
|
291
105
|
});
|
|
292
|
-
__eliscript_tdz_ready_21 = true;
|
|
293
106
|
function add_word(accumulator, index, value) {
|
|
294
107
|
while (__eliscript_numeric_relation(">", value, 0)) {
|
|
295
108
|
{
|
|
@@ -297,7 +110,7 @@ function add_word(accumulator, index, value) {
|
|
|
297
110
|
{
|
|
298
111
|
let total = __eliscript_value_8;
|
|
299
112
|
((accumulator)[index] = __eliscript_numeric_rem(total, 65536));
|
|
300
|
-
((value = ((
|
|
113
|
+
((value = (floor_native(__eliscript_numeric_div(value, 65536)) + floor_native(__eliscript_numeric_div(total, 65536)))));
|
|
301
114
|
}
|
|
302
115
|
}
|
|
303
116
|
((index = (index + 1)));
|
|
@@ -307,8 +120,8 @@ function add_word(accumulator, index, value) {
|
|
|
307
120
|
function add_number(accumulator, low, high, exponent) {
|
|
308
121
|
{
|
|
309
122
|
let shift = ((exponent === 0) ? 0 : __eliscript_numeric_decrement(exponent));
|
|
310
|
-
let index = (
|
|
311
|
-
let scale = (
|
|
123
|
+
let index = floor_native(__eliscript_numeric_div(shift, 16));
|
|
124
|
+
let scale = power_native(2, __eliscript_numeric_rem(shift, 16));
|
|
312
125
|
let upper = __eliscript_numeric_or(__eliscript_numeric_and(high, 1048575), ((exponent === 0) ? 0 : 1048576));
|
|
313
126
|
add_word(accumulator, index, __eliscript_numeric_mul(__eliscript_numeric_and(low, 65535), scale));
|
|
314
127
|
add_word(accumulator, (index + 1), __eliscript_numeric_mul(__eliscript_numeric_ushr(low, 16), scale));
|
|
@@ -317,7 +130,7 @@ function add_number(accumulator, low, high, exponent) {
|
|
|
317
130
|
}
|
|
318
131
|
}
|
|
319
132
|
function accumulator_bit(accumulator, position) {
|
|
320
|
-
return __eliscript_numeric_and(__eliscript_numeric_ushr((accumulator)[(
|
|
133
|
+
return __eliscript_numeric_and(__eliscript_numeric_ushr((accumulator)[floor_native(__eliscript_numeric_div(position, 16))], __eliscript_numeric_rem(position, 16)), 1);
|
|
321
134
|
}
|
|
322
135
|
function finish_sum(positive, negative, all_minus_zero) {
|
|
323
136
|
{
|
|
@@ -419,7 +232,7 @@ function finish_sum(positive, negative, all_minus_zero) {
|
|
|
419
232
|
if (__eliscript_numeric_relation(">=", shift, 2046)) {
|
|
420
233
|
return number_from_words(0, (sign + 2146435072));
|
|
421
234
|
} else {
|
|
422
|
-
return number_from_words(__eliscript_numeric_rem(significand, 4294967296), (sign + __eliscript_numeric_mul((shift + 1), 1048576) + __eliscript_numeric_sub((
|
|
235
|
+
return number_from_words(__eliscript_numeric_rem(significand, 4294967296), (sign + __eliscript_numeric_mul((shift + 1), 1048576) + __eliscript_numeric_sub(floor_native(__eliscript_numeric_div(significand, 4294967296)), 1048576)));
|
|
423
236
|
}
|
|
424
237
|
}
|
|
425
238
|
}
|
|
@@ -434,10 +247,10 @@ function finish_sum(positive, negative, all_minus_zero) {
|
|
|
434
247
|
}
|
|
435
248
|
}
|
|
436
249
|
function object_p(value) {
|
|
437
|
-
return ((__eliscript_value_28) => (__eliscript_truthy(__eliscript_value_28) ? (
|
|
250
|
+
return ((__eliscript_value_28) => (__eliscript_truthy(__eliscript_value_28) ? same_native(object_native(value), value) : __eliscript_value_28))((!(value == null)));
|
|
438
251
|
}
|
|
439
252
|
function number_p(value) {
|
|
440
|
-
return ((__eliscript_value_29) => (__eliscript_truthy(__eliscript_value_29) ? __eliscript_value_29 : ((__eliscript_value_30) => (__eliscript_truthy(__eliscript_value_30) ? __eliscript_value_30 : ((__eliscript_value_31) => (__eliscript_truthy(__eliscript_value_31) ? __eliscript_value_31 : (
|
|
253
|
+
return ((__eliscript_value_29) => (__eliscript_truthy(__eliscript_value_29) ? __eliscript_value_29 : ((__eliscript_value_30) => (__eliscript_truthy(__eliscript_value_30) ? __eliscript_value_30 : ((__eliscript_value_31) => (__eliscript_truthy(__eliscript_value_31) ? __eliscript_value_31 : same_native(value, __eliscript_numeric_neg(globalThis.Infinity))))(same_native(value, globalThis.Infinity))))(nan_native(value))))(finite_native(value));
|
|
441
254
|
}
|
|
442
255
|
function close_abrupt(iterator, error) {
|
|
443
256
|
(() => {
|
|
@@ -448,11 +261,11 @@ function close_abrupt(iterator, error) {
|
|
|
448
261
|
let method = __eliscript_value_32;
|
|
449
262
|
if ((!(method == null))) {
|
|
450
263
|
{
|
|
451
|
-
const __eliscript_value_33 = (
|
|
264
|
+
const __eliscript_value_33 = apply_native(method, iterator, []);
|
|
452
265
|
{
|
|
453
266
|
let result = __eliscript_value_33;
|
|
454
267
|
if ((!__eliscript_truthy(object_p(result)))) {
|
|
455
|
-
return ((__eliscript_value_34) => { throw __eliscript_value_34; })(new (
|
|
268
|
+
return ((__eliscript_value_34) => { throw __eliscript_value_34; })(new (type_error_native)("iterator return must be an object"));
|
|
456
269
|
} else {
|
|
457
270
|
return null;
|
|
458
271
|
}
|
|
@@ -471,15 +284,15 @@ function close_abrupt(iterator, error) {
|
|
|
471
284
|
}
|
|
472
285
|
const sumPrecise = ((items) => {
|
|
473
286
|
{
|
|
474
|
-
let method = (items)[
|
|
475
|
-
let iterator = (
|
|
287
|
+
let method = (items)[iterator_key];
|
|
288
|
+
let iterator = apply_native(method, items, []);
|
|
476
289
|
if ((!__eliscript_truthy(object_p(iterator)))) {
|
|
477
|
-
((__eliscript_value_36) => { throw __eliscript_value_36; })(new (
|
|
290
|
+
((__eliscript_value_36) => { throw __eliscript_value_36; })(new (type_error_native)("iterator must be an object"));
|
|
478
291
|
}
|
|
479
292
|
{
|
|
480
293
|
const __eliscript_value_37 = (iterator)["next"];
|
|
481
|
-
const __eliscript_value_38 = new (
|
|
482
|
-
const __eliscript_value_39 = new (
|
|
294
|
+
const __eliscript_value_38 = new (words_constructor)(135);
|
|
295
|
+
const __eliscript_value_39 = new (words_constructor)(135);
|
|
483
296
|
const __eliscript_value_40 = true;
|
|
484
297
|
const __eliscript_value_41 = false;
|
|
485
298
|
const __eliscript_value_42 = false;
|
|
@@ -498,13 +311,13 @@ const sumPrecise = ((items) => {
|
|
|
498
311
|
let done = __eliscript_value_45;
|
|
499
312
|
while ((!__eliscript_truthy(done))) {
|
|
500
313
|
{
|
|
501
|
-
const __eliscript_value_46 = (
|
|
314
|
+
const __eliscript_value_46 = apply_native(next, iterator, []);
|
|
502
315
|
{
|
|
503
316
|
let step = __eliscript_value_46;
|
|
504
317
|
if ((!__eliscript_truthy(object_p(step)))) {
|
|
505
|
-
((__eliscript_value_47) => { throw __eliscript_value_47; })(new (
|
|
318
|
+
((__eliscript_value_47) => { throw __eliscript_value_47; })(new (type_error_native)("iterator result must be an object"));
|
|
506
319
|
}
|
|
507
|
-
if (__eliscript_truthy((
|
|
320
|
+
if (__eliscript_truthy(boolean_native((step)["done"]))) {
|
|
508
321
|
((done = true));
|
|
509
322
|
} else {
|
|
510
323
|
{
|
|
@@ -512,24 +325,24 @@ const sumPrecise = ((items) => {
|
|
|
512
325
|
{
|
|
513
326
|
let item = __eliscript_value_48;
|
|
514
327
|
if (__eliscript_numeric_relation(">=", count, 9007199254740991)) {
|
|
515
|
-
close_abrupt(iterator, new (
|
|
328
|
+
close_abrupt(iterator, new (range_error_native)("too many sumPrecise elements"));
|
|
516
329
|
}
|
|
517
330
|
if ((!__eliscript_truthy(number_p(item)))) {
|
|
518
|
-
close_abrupt(iterator, new (
|
|
331
|
+
close_abrupt(iterator, new (type_error_native)("sumPrecise requires Number elements"));
|
|
519
332
|
}
|
|
520
333
|
((count = (count + 1)));
|
|
521
|
-
((all_minus_zero = ((__eliscript_value_49) => (__eliscript_truthy(__eliscript_value_49) ? (
|
|
522
|
-
if (__eliscript_truthy((
|
|
334
|
+
((all_minus_zero = ((__eliscript_value_49) => (__eliscript_truthy(__eliscript_value_49) ? same_native(item, -0.0) : __eliscript_value_49))(all_minus_zero)));
|
|
335
|
+
if (__eliscript_truthy(nan_native(item))) {
|
|
523
336
|
((nan = true));
|
|
524
337
|
} else {
|
|
525
|
-
if (__eliscript_truthy((
|
|
338
|
+
if (__eliscript_truthy(same_native(item, globalThis.Infinity))) {
|
|
526
339
|
((positive_infinity = true));
|
|
527
340
|
} else {
|
|
528
|
-
if (__eliscript_truthy((
|
|
341
|
+
if (__eliscript_truthy(same_native(item, __eliscript_numeric_neg(globalThis.Infinity)))) {
|
|
529
342
|
((negative_infinity = true));
|
|
530
343
|
} else {
|
|
531
344
|
if ((!__eliscript_truthy(((__eliscript_value_50) => (__eliscript_truthy(__eliscript_value_50) ? __eliscript_value_50 : ((__eliscript_value_51) => (__eliscript_truthy(__eliscript_value_51) ? __eliscript_value_51 : negative_infinity))(positive_infinity)))(nan)))) {
|
|
532
|
-
(
|
|
345
|
+
apply_native(set_number, view, [0, item, true]);
|
|
533
346
|
{
|
|
534
347
|
let low = word_at(0);
|
|
535
348
|
let high = word_at(4);
|
|
@@ -565,14 +378,13 @@ const sumPrecise = ((items) => {
|
|
|
565
378
|
}
|
|
566
379
|
}
|
|
567
380
|
});
|
|
568
|
-
|
|
569
|
-
(
|
|
570
|
-
(
|
|
571
|
-
(
|
|
572
|
-
(__eliscript_tdz_read_2())((__eliscript_tdz_read_22()), "length", ({"value": 1, "writable": false, "enumerable": false, "configurable": true}));
|
|
381
|
+
define_native(f16round, "name", ({"value": "f16round", "writable": false, "enumerable": false, "configurable": true}));
|
|
382
|
+
define_native(f16round, "length", ({"value": 1, "writable": false, "enumerable": false, "configurable": true}));
|
|
383
|
+
define_native(sumPrecise, "name", ({"value": "sumPrecise", "writable": false, "enumerable": false, "configurable": true}));
|
|
384
|
+
define_native(sumPrecise, "length", ({"value": 1, "writable": false, "enumerable": false, "configurable": true}));
|
|
573
385
|
const hypot = ((...inputs) => {
|
|
574
386
|
{
|
|
575
|
-
const __eliscript_value_56 = new (
|
|
387
|
+
const __eliscript_value_56 = new (numbers_constructor)(((inputs) ?? []).length);
|
|
576
388
|
const __eliscript_value_57 = 0;
|
|
577
389
|
const __eliscript_value_58 = false;
|
|
578
390
|
const __eliscript_value_59 = false;
|
|
@@ -588,9 +400,9 @@ const hypot = ((...inputs) => {
|
|
|
588
400
|
let sum = __eliscript_value_61;
|
|
589
401
|
let correction = __eliscript_value_62;
|
|
590
402
|
while (__eliscript_numeric_relation("<", index, ((inputs) ?? []).length)) {
|
|
591
|
-
(
|
|
403
|
+
apply_native(set_number, view, [0, (inputs)[index], true]);
|
|
592
404
|
{
|
|
593
|
-
let number = (
|
|
405
|
+
let number = apply_native(get_number, view, [0, true]);
|
|
594
406
|
let magnitude = (__eliscript_numeric_relation("<", number, 0) ? __eliscript_numeric_neg(number) : number);
|
|
595
407
|
((values)[index] = magnitude);
|
|
596
408
|
if (((__eliscript_value_63, __eliscript_value_64) => (__eliscript_value_63 !== __eliscript_value_64))(magnitude, magnitude)) {
|
|
@@ -629,23 +441,22 @@ const hypot = ((...inputs) => {
|
|
|
629
441
|
}
|
|
630
442
|
((index = (index + 1)));
|
|
631
443
|
}
|
|
632
|
-
return __eliscript_numeric_mul(maximum, (
|
|
444
|
+
return __eliscript_numeric_mul(maximum, sqrt_native(sum));
|
|
633
445
|
}
|
|
634
446
|
}
|
|
635
447
|
}
|
|
636
448
|
}
|
|
637
449
|
}
|
|
638
450
|
});
|
|
639
|
-
__eliscript_tdz_ready_23 = true;
|
|
640
451
|
const pow = ((base, exponent) => {
|
|
641
|
-
(
|
|
452
|
+
apply_native(set_number, view, [0, base, true]);
|
|
642
453
|
{
|
|
643
|
-
const __eliscript_value_65 = (
|
|
454
|
+
const __eliscript_value_65 = apply_native(get_number, view, [0, true]);
|
|
644
455
|
{
|
|
645
456
|
let x = __eliscript_value_65;
|
|
646
|
-
(
|
|
457
|
+
apply_native(set_number, view, [0, exponent, true]);
|
|
647
458
|
{
|
|
648
|
-
const __eliscript_value_66 = (
|
|
459
|
+
const __eliscript_value_66 = apply_native(get_number, view, [0, true]);
|
|
649
460
|
const __eliscript_value_67 = new (globalThis.DataView)(new (globalThis.ArrayBuffer)(32));
|
|
650
461
|
{
|
|
651
462
|
let y = __eliscript_value_66;
|
|
@@ -685,16 +496,16 @@ const pow = ((base, exponent) => {
|
|
|
685
496
|
let heap_math_exp_scale = __eliscript_value_82;
|
|
686
497
|
let heap_math_kernel_pow = __eliscript_value_83;
|
|
687
498
|
(pow_load_f64 = ((offset) => {
|
|
688
|
-
return (
|
|
499
|
+
return apply_native(get_number, scratch_view, [offset, true]);
|
|
689
500
|
}));
|
|
690
501
|
(pow_store_f64 = ((offset, value) => {
|
|
691
|
-
return (
|
|
502
|
+
return apply_native(set_number, scratch_view, [offset, value, true]);
|
|
692
503
|
}));
|
|
693
504
|
(pow_load_u32 = ((offset) => {
|
|
694
|
-
return (
|
|
505
|
+
return apply_native(get_word, scratch_view, [offset, true]);
|
|
695
506
|
}));
|
|
696
507
|
(pow_store_u32 = ((offset, value) => {
|
|
697
|
-
return (
|
|
508
|
+
return apply_native(set_word, scratch_view, [offset, value, true]);
|
|
698
509
|
}));
|
|
699
510
|
(pow_literal = ((value) => {
|
|
700
511
|
return value;
|
|
@@ -714,7 +525,7 @@ const pow = ((base, exponent) => {
|
|
|
714
525
|
return __eliscript_numeric_neg(value);
|
|
715
526
|
}));
|
|
716
527
|
(pow_sqrt = ((value) => {
|
|
717
|
-
return (
|
|
528
|
+
return sqrt_native(value);
|
|
718
529
|
}));
|
|
719
530
|
(pow_and = ((a, b) => {
|
|
720
531
|
return __eliscript_numeric_ushr(__eliscript_numeric_and(a, b), 0);
|
|
@@ -1104,13 +915,12 @@ const pow = ((base, exponent) => {
|
|
|
1104
915
|
}
|
|
1105
916
|
}
|
|
1106
917
|
});
|
|
1107
|
-
|
|
1108
|
-
(
|
|
1109
|
-
(
|
|
1110
|
-
(
|
|
1111
|
-
(
|
|
1112
|
-
(
|
|
1113
|
-
(
|
|
1114
|
-
(
|
|
1115
|
-
(__eliscript_tdz_read_2())((__eliscript_tdz_read_0()), "sumPrecise", ({"value": (__eliscript_tdz_read_22()), "writable": true, "enumerable": false, "configurable": true}));
|
|
918
|
+
define_native(pow, "name", ({"value": "pow", "writable": false, "enumerable": false, "configurable": true}));
|
|
919
|
+
define_native(pow, "length", ({"value": 2, "writable": false, "enumerable": false, "configurable": true}));
|
|
920
|
+
define_native(namespace, "pow", ({"value": pow, "writable": true, "enumerable": false, "configurable": true}));
|
|
921
|
+
define_native(hypot, "name", ({"value": "hypot", "writable": false, "enumerable": false, "configurable": true}));
|
|
922
|
+
define_native(hypot, "length", ({"value": 2, "writable": false, "enumerable": false, "configurable": true}));
|
|
923
|
+
define_native(namespace, "hypot", ({"value": hypot, "writable": true, "enumerable": false, "configurable": true}));
|
|
924
|
+
define_native(namespace, "f16round", ({"value": f16round, "writable": true, "enumerable": false, "configurable": true}));
|
|
925
|
+
define_native(namespace, "sumPrecise", ({"value": sumPrecise, "writable": true, "enumerable": false, "configurable": true}));
|
|
1116
926
|
export {f16round, sumPrecise};
|