runmat 0.4.5-dev.0 → 0.4.5-dev.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/artifacts/stdlib.snapshot +0 -0
- package/dist/generated/builtin-examples-catalog.d.ts.map +1 -1
- package/dist/generated/builtin-examples-catalog.js +1 -1
- package/dist/generated/builtin-examples-catalog.js.map +1 -1
- package/dist/generated/builtins/format.d.ts +4 -0
- package/dist/generated/builtins/format.d.ts.map +1 -0
- package/dist/generated/builtins/format.js +147 -0
- package/dist/generated/builtins/format.js.map +1 -0
- package/dist/generated/builtins-manifest.d.ts.map +1 -1
- package/dist/generated/builtins-manifest.js +24 -0
- package/dist/generated/builtins-manifest.js.map +1 -1
- package/dist/lsp/runmat_lsp.d.ts +2 -2
- package/dist/lsp/runmat_lsp.js +4 -4
- package/dist/lsp/runmat_lsp_bg.wasm +0 -0
- package/dist/lsp/runmat_lsp_bg.wasm.d.ts +2 -2
- package/dist/pkg-web/runmat_wasm_web.d.ts +3 -3
- package/dist/pkg-web/runmat_wasm_web.js +7 -7
- package/dist/pkg-web/runmat_wasm_web_bg.wasm +0 -0
- package/dist/pkg-web/runmat_wasm_web_bg.wasm.d.ts +3 -3
- package/dist/runtime/stdlib.snapshot +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/format.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UA8IjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "format",
|
|
5
|
+
"category": "io",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"format",
|
|
8
|
+
"display",
|
|
9
|
+
"precision",
|
|
10
|
+
"numeric",
|
|
11
|
+
"short",
|
|
12
|
+
"long",
|
|
13
|
+
"scientific",
|
|
14
|
+
"rational",
|
|
15
|
+
"hex"
|
|
16
|
+
],
|
|
17
|
+
"summary": "Set the numeric display format for console output, controlling how floating-point numbers are shown.",
|
|
18
|
+
"references": [
|
|
19
|
+
"https://www.mathworks.com/help/matlab/ref/format.html"
|
|
20
|
+
],
|
|
21
|
+
"gpu_support": {
|
|
22
|
+
"elementwise": false,
|
|
23
|
+
"reduction": false,
|
|
24
|
+
"precisions": [],
|
|
25
|
+
"broadcasting": "none",
|
|
26
|
+
"notes": "format is a display-only setting; it has no effect on GPU computation or residency."
|
|
27
|
+
},
|
|
28
|
+
"fusion": {
|
|
29
|
+
"elementwise": false,
|
|
30
|
+
"reduction": false,
|
|
31
|
+
"max_inputs": 0,
|
|
32
|
+
"constants": "none"
|
|
33
|
+
},
|
|
34
|
+
"requires_feature": null,
|
|
35
|
+
"tested": {
|
|
36
|
+
"unit": "builtins::io::format::tests",
|
|
37
|
+
"integration": null
|
|
38
|
+
},
|
|
39
|
+
"description": "`format` controls how numeric values appear in the Command Window. The setting is session-wide and persists until changed. Supported numeric precision modes: `short` (default), `long`, `shortE`, `longE`, `shortG`, `longG`, `rat`, and `hex`. Spacing modes `compact` and `loose` are accepted without error but are not yet implemented. Calling `format` without arguments resets to `short`.",
|
|
40
|
+
"behaviors": [
|
|
41
|
+
"Calling `format` with no arguments resets to the default `short` mode.",
|
|
42
|
+
"`format short` displays 4 decimal places in fixed notation for values in [0.001, 10000); uses scientific notation outside that range.",
|
|
43
|
+
"`format long` displays 15 decimal places in fixed notation for values in [0.001, 10000); uses 14-decimal scientific notation outside that range.",
|
|
44
|
+
"`format shortE` always uses scientific notation with 4 decimal places (e.g., `3.1416e+00`).",
|
|
45
|
+
"`format longE` always uses scientific notation with 14 decimal places.",
|
|
46
|
+
"`format shortG` uses the more compact of fixed/scientific notation with 5 significant digits, trimming trailing zeros.",
|
|
47
|
+
"`format longG` uses the more compact of fixed/scientific notation with 15 significant digits, trimming trailing zeros.",
|
|
48
|
+
"`format rat` approximates values as ratios of small integers using a tolerance of 5×10⁻⁷ (e.g., `355/113` for pi). `format rational` is accepted as an alias.",
|
|
49
|
+
"`format hex` displays the IEEE 754 double-precision hexadecimal bit pattern (e.g., `400921fb54442d18` for pi).",
|
|
50
|
+
"`format compact` and `format loose` are accepted without error for script compatibility but do not yet change output spacing.",
|
|
51
|
+
"The format setting applies to auto-print results and `disp` output. `fprintf`/`sprintf` use their own explicit format specifiers and are not affected.",
|
|
52
|
+
"Mode names are case-insensitive."
|
|
53
|
+
],
|
|
54
|
+
"examples": [
|
|
55
|
+
{
|
|
56
|
+
"description": "Default short format",
|
|
57
|
+
"input": "format short\npi",
|
|
58
|
+
"output": "ans = 3.1416"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"description": "Long format for full precision",
|
|
62
|
+
"input": "format long\npi",
|
|
63
|
+
"output": "ans = 3.141592653589793"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"description": "Scientific notation with short precision",
|
|
67
|
+
"input": "format shortE\npi",
|
|
68
|
+
"output": "ans = 3.1416e+00"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"description": "Scientific notation with full precision",
|
|
72
|
+
"input": "format longE\npi",
|
|
73
|
+
"output": "ans = 3.14159265358979e+00"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"description": "Rational approximation",
|
|
77
|
+
"input": "format rat\npi",
|
|
78
|
+
"output": "ans = 355/113"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"description": "Hexadecimal IEEE 754 representation",
|
|
82
|
+
"input": "format hex\npi",
|
|
83
|
+
"output": "ans = 400921fb54442d18"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"description": "Resetting to default",
|
|
87
|
+
"input": "format\npi",
|
|
88
|
+
"output": "ans = 3.1416"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"faqs": [
|
|
92
|
+
{
|
|
93
|
+
"question": "Does `format` affect computation results?",
|
|
94
|
+
"answer": "No. `format` only changes how values are displayed. Internal precision is always IEEE 754 double."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"question": "Is the format setting persistent across cells?",
|
|
98
|
+
"answer": "Yes. The setting is stored per-session thread and remains active until changed by another `format` call."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"question": "What is the default format?",
|
|
102
|
+
"answer": "`format short` — 4 decimal places in fixed notation, falling back to scientific for very large or very small values."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"question": "Does `format` affect `disp`?",
|
|
106
|
+
"answer": "Yes. `disp` and auto-print both use the active format setting. `fprintf` and `sprintf` use their own explicit format specifiers and ignore this setting."
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"question": "Are format mode names case-sensitive?",
|
|
110
|
+
"answer": "No. `format SHORT`, `format Short`, and `format short` are all equivalent."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"question": "What does `format rat` do for integers?",
|
|
114
|
+
"answer": "Integers are displayed as-is without a denominator (e.g., `42` rather than `42/1`). `format rational` is accepted as an alias for `format rat`."
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"links": [
|
|
118
|
+
{
|
|
119
|
+
"label": "disp",
|
|
120
|
+
"url": "./disp"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"label": "fprintf",
|
|
124
|
+
"url": "./fprintf"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"label": "sprintf",
|
|
128
|
+
"url": "./sprintf"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"source": {
|
|
132
|
+
"label": "`crates/runmat-runtime/src/builtins/io/format.rs`",
|
|
133
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/io/format.rs"
|
|
134
|
+
},
|
|
135
|
+
"gpu_residency": "`format` is a display-only setting with no effect on GPU residency or acceleration.",
|
|
136
|
+
"gpu_behavior": [
|
|
137
|
+
"`format` does not interact with GPU tensors. It only affects how values are rendered after being gathered to the host for display."
|
|
138
|
+
],
|
|
139
|
+
"key": "format",
|
|
140
|
+
"slug": "format",
|
|
141
|
+
"aliases": [],
|
|
142
|
+
"categoryPath": [
|
|
143
|
+
"io"
|
|
144
|
+
]
|
|
145
|
+
};
|
|
146
|
+
export default builtinDoc;
|
|
147
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/generated/builtins/format.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,IAAI;IAChB,UAAU,EAAE;QACV,QAAQ;QACR,SAAS;QACT,WAAW;QACX,SAAS;QACT,OAAO;QACP,MAAM;QACN,YAAY;QACZ,UAAU;QACV,KAAK;KACN;IACD,SAAS,EAAE,sGAAsG;IACjH,YAAY,EAAE;QACZ,uDAAuD;KACxD;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,qFAAqF;KAC/F;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,MAAM;KACpB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,6BAA6B;QACrC,aAAa,EAAE,IAAI;KACpB;IACD,aAAa,EAAE,oYAAoY;IACnZ,WAAW,EAAE;QACX,wEAAwE;QACxE,uIAAuI;QACvI,kJAAkJ;QAClJ,6FAA6F;QAC7F,wE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AK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,mDAAmD;QAC5D,KAAK,EAAE,gGAAgG;KACxG;IACD,eAAe,EAAE,qFAAqF;IACtG,cAAc,EAAE;QACd,oIAAoI;KACrI;IACD,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,IAAI;KACL;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,EAquOjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA+W9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
|
|
@@ -2289,6 +2289,29 @@ export const builtinManifest = [
|
|
|
2289
2289
|
"summary": "Open a file and obtain a MATLAB-compatible file identifier.",
|
|
2290
2290
|
"exampleCount": 7
|
|
2291
2291
|
},
|
|
2292
|
+
{
|
|
2293
|
+
"key": "format",
|
|
2294
|
+
"title": "format",
|
|
2295
|
+
"slug": "format",
|
|
2296
|
+
"aliases": [],
|
|
2297
|
+
"category": "io",
|
|
2298
|
+
"categoryPath": [
|
|
2299
|
+
"io"
|
|
2300
|
+
],
|
|
2301
|
+
"keywords": [
|
|
2302
|
+
"format",
|
|
2303
|
+
"display",
|
|
2304
|
+
"precision",
|
|
2305
|
+
"numeric",
|
|
2306
|
+
"short",
|
|
2307
|
+
"long",
|
|
2308
|
+
"scientific",
|
|
2309
|
+
"rational",
|
|
2310
|
+
"hex"
|
|
2311
|
+
],
|
|
2312
|
+
"summary": "Set the numeric display format for console output, controlling how floating-point numbers are shown.",
|
|
2313
|
+
"exampleCount": 7
|
|
2314
|
+
},
|
|
2292
2315
|
{
|
|
2293
2316
|
"key": "fprintf",
|
|
2294
2317
|
"title": "fprintf",
|
|
@@ -7489,6 +7512,7 @@ export const builtinDocLoaders = {
|
|
|
7489
7512
|
"flipud": () => import("./builtins/flipud.js").then((mod) => mod.default),
|
|
7490
7513
|
"floor": () => import("./builtins/floor.js").then((mod) => mod.default),
|
|
7491
7514
|
"fopen": () => import("./builtins/fopen.js").then((mod) => mod.default),
|
|
7515
|
+
"format": () => import("./builtins/format.js").then((mod) => mod.default),
|
|
7492
7516
|
"fprintf": () => import("./builtins/fprintf.js").then((mod) => mod.default),
|
|
7493
7517
|
"fread": () => import("./builtins/fread.js").then((mod) => mod.default),
|
|
7494
7518
|
"frewind": () => import("./builtins/frewind.js").then((mod) => mod.default),
|