metanum 2.1.0 → 2.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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![NPM](https://img.shields.io/npm/v/metanum.svg)](https://www.npmjs.com/package/metanum)
4
4
 
5
- - MetaNum v2.0 by dlsdl
5
+ - MetaNum v2.1.1 by dlsdl
6
6
 
7
7
  A huge number library holding up to X↑↑X&9e15.
8
8
 
@@ -667,6 +667,10 @@ MetaNum(10).h100(20); //10{ω^2}20=10{ω*20}10=10{ω*19+9}^8 10{ω*19+8}^8 ...
667
667
 
668
668
  # dlsdl's Letter Notation
669
669
 
670
+ > Formal semantics and the design decisions behind the notation are recorded in
671
+ > [docs/notation-semantics.md](docs/notation-semantics.md); the executable
672
+ > regression suite is [test_mixed.js](test_mixed.js).
673
+
670
674
  Modified from PsiCubed's letter notation(<https://googology.fandom.com/wiki/User_blog:PsiCubed2/My_Letter_Notation>)
671
675
 
672
676
  The idea here is to extend the PsiCubed's letter notation to much larger numbers reach level ε0 of FGH or HH. The properties we wish to preserve here are:
@@ -1021,18 +1025,18 @@ Every hyperoperation is stored EXACTLY while it fits the array budget and approx
1021
1025
 
1022
1026
  # Changelog
1023
1027
 
1024
-
1025
- - 2026-10-16 v2.1.0: hardy(x, base) — the second argument is the base (default 10, integer in [2,1000]); the ordinal is read off the digits of x in that base, so hardy(10,8) = H_{ω+2}(8) = 20 and hardy(10,4) = H_{ω·2+2}(4) = 24. New FGH(x, y) = hardy(y^x, y). The base-10 path is unchanged; for other bases the plain finite inputs take the base digit path (structured / power-tower inputs are rejected). test.js merged into test_mixed.js (1143 vectors), and the comments in metanum.js / format-metanum.js were tightened. Fix issue #15 (hardy ordinal rows carried a negative coefficient from the decimal point of non-integer exponents and ran one column per character — hardy("ee9.05") now reads the integer digits only, flows the fraction into the from-below base, and is monotone again); issue #17 (hardy with a non-integer mantissa at or beyond Number.MAX_VALUE collapsed to Infinity — the rest now recurses on the exact digit string, hardy("1.5e309") is finite); issue #19 (Aa3 = 2Aa3 = 10{3}10 → [[10^10,8,8]]; an integer !Aa<n> is the full 10{ω^n}10 cascade at layer 0 with @Aa<n>/#Aa<n> at layers 1/2 on the same array — past the row budget (n ≥ maxCols) the layer goes one up with the de-!-ed compact [[n],[1,0,1]] so nothing truncates; format emits exactly ONE symbol per value and the displays round-trip; toString splits "^count" tokens so multi-row cascades parse back; the "EEαEβ" display with a beyond-double exponent no longer loses its letter chain on parse, and comma-grouped displays parse back); issue #20 (the diagonal letters follow the README — Aaα = 10{α}10, so Aa1.5 = [[924.19,3]] between Aa1 and Aa2, and format is the approximate α'Aaβ' form carried to its single-letter display "EE1.537E924"/"FFFE1.745E9", round-tripped with tolerance); issue #21 (toBeaf keeps negatives as "-{5}" and sub-units as "{10,320}⁻¹", both parsed back by fromBeaf); README errata for the four !Aa/!αAaβ formulas (notation-semantics §6); issue #22 re-evaluated and left as the marker approximation — the layer-1 row format cannot express the finite-part variation of a rule-2 chain (see docs/d07-engine-design.md §7).
1026
- - 2026-9-30 v2.0.2: Fix a lot of bugs e.g. hardy(non integer > 1000) throwing, hardy beyond the 1.8e308 range fails, format of "ω^n\*large numbers" fails, some FORMAT_OPTIONS not take effect.
1027
- - 2026-9-25 v2.0.1: Fix arrow(x,y,y) not being monotone in y and array except array[0][0] may be non-integer
1028
- - 2026-9-15 v2.0: Add hyper-root & hyper-log, hardy function, fractional hyperoperation inputs, fix BEAF operation level and format
1029
- - 2026-8-18 v1.4 Support hyper operation >MSI and fix format-metanum bugs
1030
- - 2026-7-31 v1.3 Add format-metanum.js, fix basic operations, hyper operations and BEAF bugs
1031
- - 2026-7-9 v1.2 Add more hyper operations up to ε₀, add BEAF operation and fix bugs
1032
- - 2026-6-3 v1.1 Add support for very small numbers ,add more hyper operations and fix bugs
1033
- - 2026-5-23 v1.0 Rewritten and add even more hyper operations
1034
- - 2026-2-24 v0.4 Add hyper operations and extend fromString
1035
- - 2026-2-11 v0.3 Reconstruct code and correct calculating functions
1036
- - 2026-2-6 v0.2 New Metanum data structure with Cantor normal form
1037
- - 2026-2-1 v0.1 First commit
1028
+ - 2026-10-18 v2.1.1 Fix: round-trip @Aa1/#Aa1 and alpha-Gamma sub-unit forms; fix(format): exact token form for non-integer multi-a layers and past multiLetterLimit
1029
+ - 2026-10-16 v2.1.0 Add hardy(x, base) and FGH(x, base), fix issue #15, #17, #19, #20, #21, #22
1030
+ - 2026-9-30 v2.0.2 Fix a lot of bugs e.g. hardy(non integer > 1000) throwing, hardy beyond the 1.8e308 range fails, format of "ω^n\*large numbers" fails, some FORMAT_OPTIONS not take effect.
1031
+ - 2026-9-25 v2.0.1 Fix arrow(x,y,y) not being monotone in y and array except array[0][0] may be non-integer
1032
+ - 2026-9-15 v2.0.0 Add hyper-root & hyper-log, hardy function, fractional hyperoperation inputs, fix BEAF operation level and format
1033
+ - 2026-8-18 v1.4.0 Support hyper operation >MSI and fix format-metanum bugs
1034
+ - 2026-7-31 v1.3.0 Add format-metanum.js, fix basic operations, hyper operations and BEAF bugs
1035
+ - 2026-7-9 v1.2.0 Add more hyper operations up to ε₀, add BEAF operation and fix bugs
1036
+ - 2026-6-3 v1.1.0 Add support for very small numbers ,add more hyper operations and fix bugs
1037
+ - 2026-5-23 v1.0.0 Rewritten and add even more hyper operations
1038
+ - 2026-2-24 v0.4.0 Add hyper operations and extend fromString
1039
+ - 2026-2-11 v0.3.0 Reconstruct code and correct calculating functions
1040
+ - 2026-2-6 v0.2.0 New Metanum data structure with Cantor normal form
1041
+ - 2026-2-1 v0.1.0 First commit
1038
1042
 
package/format-metanum.js CHANGED
@@ -1,5 +1,6 @@
1
- // format-metanum.js by dlsdl
2
- // Adapted from format-omeganum.js by cloudytheconqueror
1
+ // Author: dlsdl v2.1.1
2
+ // v2.1.1 Fix(format): exact token form for non-integer multi-a layers and past multiLetterLimit
3
+ // Code snippets and templates from format-omeganum.js
3
4
  // Uses dlsdl's Letter Notation (see README.md)
4
5
 
5
6
  // Set to 1 to print debug information to console
@@ -23,6 +24,10 @@ const FORMAT_OPTIONS = {
23
24
  epsilonSignificantDigits: 6 //0~9
24
25
  }
25
26
 
27
+ // #28: keep the exact A(a×k) token past multiLetterLimit up to this many a's;
28
+ // beyond it, fall back to the historical single-letter carry approximation.
29
+ const MULTI_TOKEN_CAP = 64
30
+
26
31
  // ─── Utility Functions ───────────────────────────────────────────
27
32
 
28
33
  function commaFormat(num) {
@@ -934,24 +939,25 @@ function formatLayer(num, precision, precision2, precision3, precision4) {
934
939
  let mInt = Math.floor(compactBase)
935
940
  let frac = compactBase - mInt
936
941
  let mant = 2 * Math.pow(5, frac)
937
- let limit = Math.max(2, FORMAT_OPTIONS.multiLetterLimit | 0)
938
- if (mInt + 1 > limit) {
939
- // Carry to the SINGLE-letter form sym αΓβ — same rule as "!":
940
- // Γ is the finite level the diagonal names (10{ω^m}10 → letter of
941
- // m) and β is the diagonal's argument, so the symbols stack
942
- // identically: 10{ω^10}10 → !1.000N10, 10{ω^(ω^10)}10 → @1.000N10
943
- let total = num.layer + 1
944
- let body = regularFormat(1, precision4) + letterName(mInt) +
945
- formatR0Arg(10, precision4)
946
- if (total <= SYMBOLS.length) return SYMBOLS[total - 1] + body
947
- return body + "ε" + commaFormat(total)
942
+ // #28: past multiLetterLimit the old single-letter carry (!1.000N10)
943
+ // did not round-trip — it added a layer and could not name the exact
944
+ // diagonal. Keep the exact A(a×m)10 token while the string stays
945
+ // reasonable; only fall back to the carry past a hard safety cap.
946
+ if (mInt <= MULTI_TOKEN_CAP) {
947
+ // Stored layer L: exactly ONE symbol per ω^ layer (symbolName(L));
948
+ // stacking symbols ("@!…") is invalid (issue #19). The body is
949
+ // the diagonal letter A(a×m)10 at the smooth mantissa. (Layers
950
+ // past the symbol list already returned through the ε branch.)
951
+ return symbolName(num.layer) + regularFormat(mant, precision4) +
952
+ "A" + "a".repeat(mInt) + "10"
948
953
  }
949
- // Stored layer L: exactly ONE symbol per ω^ layer (symbolName(L));
950
- // stacking symbols ("@!…") is invalid (issue #19). The body is the
951
- // diagonal letter A(a×m)10 at the smooth mantissa. (Layers past the
952
- // symbol list already returned through the ε branch above.)
953
- return symbolName(num.layer) + regularFormat(mant, precision4) +
954
- "A" + "a".repeat(mInt) + "10"
954
+ // Hard-cap fallback: keep the argument (10 for a compact diagonal) but
955
+ // the level is the historical single-letter carry approximation.
956
+ let total = num.layer + 1
957
+ let body = regularFormat(1, precision4) + letterName(mInt) +
958
+ formatR0Arg(10, precision4)
959
+ if (total <= SYMBOLS.length) return SYMBOLS[total - 1] + body
960
+ return body + "ε" + commaFormat(total)
955
961
  }
956
962
 
957
963
  // For !, @, #, $, %, &, ~, <, >, ? symbols: prefix the symbol. When the
@@ -1688,13 +1694,21 @@ function formatOrdinal(num, precision, precision4) {
1688
1694
  // "2.000Aaaa3" — not the historical anchor-A "2.000Aaaa10".
1689
1695
  let diagMant = 2 * Math.pow(5, base - Math.floor(base))
1690
1696
  let diagBeta = top
1691
- // multiLetterLimit symbol carry: A + aaZeroCount a's is
1692
- // aaZeroCount+1 letters — past the limit the diagonal reads as
1693
- // one more symbol with the SINGLE letter of the finite level
1694
- // aaZeroCount (10{ω^10}10 → !1.000N10)
1695
- if (aaZeroCount + 1 > Math.max(2, FORMAT_OPTIONS.multiLetterLimit | 0)) {
1697
+ // #26/#28: a single multi-a diagonal marker round-trips exactly
1698
+ // as the letter token itself (Aaa1.5, Aaaaa3.5, Aaaaa10). The
1699
+ // αAaaβ spelling is only used for integer arguments that stay
1700
+ // inside multiLetterLimit (α=2); past the limit the old
1701
+ // single-letter carry hard-coded 10 and did not round-trip.
1702
+ let multiLimit = Math.max(2, FORMAT_OPTIONS.multiLetterLimit | 0)
1703
+ if (aaZeroCount >= 2 && (base !== top || aaZeroCount + 1 > multiLimit)) {
1704
+ let argStr = String(base)
1705
+ if (/e-/i.test(argStr)) argStr = base.toFixed(20)
1706
+ argStr = argStr.replace(/e\+?/i, "E")
1707
+ if (aaZeroCount <= MULTI_TOKEN_CAP) return letter + argStr
1708
+ // Hard-cap fallback: preserve the argument but accept the
1709
+ // historical single-letter level approximation.
1696
1710
  return "!" + regularFormat(1, precision4) +
1697
- letterName(aaZeroCount) + formatR0Arg(10, precision4)
1711
+ letterName(aaZeroCount) + argStr
1698
1712
  }
1699
1713
  return regularFormat(diagMant, precision4) + letter + commaFormat(diagBeta)
1700
1714
  }
package/metanum.js CHANGED
@@ -1,5 +1,5 @@
1
- //Author: dlsdl v2.1
2
- //v2.1
1
+ //Author: dlsdl v2.1.1
2
+ //v2.1.1 Fix: round-trip @Aa1/#Aa1 and alpha-Gamma sub-unit forms; fix(format): exact token form for non-integer multi-a layers and past multiLetterLimit
3
3
  //Code snippets and templates from OmegaNum.js
4
4
 
5
5
  ;(function (globalScope) {
@@ -5731,6 +5731,28 @@
5731
5731
  }
5732
5732
  }
5733
5733
 
5734
+ // #26 — legacy binary form with diagonal depth k≥2: [sym] α A(a×k) β
5735
+ // is [sym] A(a×k)(β + log₅(α/2)). Current format() uses the exact
5736
+ // token spelling (Aaa1.5) for these values, but the older
5737
+ // @Aa1.5 → "!4.472Aaa1" / #Aa2.5 → "@4.472Aaaa2" spellings must keep
5738
+ // parsing to the right depth. (k=1 keeps decision-1B semantics above.)
5739
+ var aaDeepMatch = rem.match(/^([!@#\$%&~<>?]?)(\d+(?:\.\d+)?)A(a{2,})(\d+(?:\.\d+)?(?:[Ee]\d+)?)$/);
5740
+ if (aaDeepMatch) {
5741
+ var adSym = aaDeepMatch[1] || "";
5742
+ var adAlpha = Number(aaDeepMatch[2]);
5743
+ var adDepth = aaDeepMatch[3].length;
5744
+ var adBeta = Number(aaDeepMatch[4]);
5745
+ if (isFinite(adAlpha) && adAlpha > 0 && isFinite(adBeta)) {
5746
+ var adX = adBeta + Math.log(adAlpha / 2) / Math.log(5);
5747
+ var adVal = Q.fromString("A" + new Array(adDepth + 1).join("a") + String(adX));
5748
+ if (adSym) {
5749
+ adVal.layer = (adVal.layer || 0) + ("!@#$%&~<>?".indexOf(adSym) + 1);
5750
+ }
5751
+ if (negateIt) adVal.sign = -1;
5752
+ return adVal;
5753
+ }
5754
+ }
5755
+
5734
5756
  // Canonical diagonal-letter output "mantissa LETTER β" (LETTER any
5735
5757
  // multi-letter token ending in 'a'), with the dlsdl diagonal mantissa
5736
5758
  // α ∈ [2,10): the exact anchor α=2.000 gives the plain letter application
@@ -5766,6 +5788,41 @@
5766
5788
  // the fractional-argument machinery and is not accepted here.
5767
5789
  rem = rem.replace(/^([!@#\$%&~<>?]?)1\.0+(?=[A-Z])/, '$1');
5768
5790
 
5791
+ // #19 — layer symbol + SINGLE-letter form. format() emits this for
5792
+ // @Aa1 (!1.000N10) and for @Aa<n> past multiLetterLimit. Parse the
5793
+ // inner value at layer 0 first, then add exactly one layer per symbol
5794
+ // (! → 1, @ → 2, …). Setting the layer before parsing would make the
5795
+ // normalizer rewrite the inner cascade into a row and lose its shape.
5796
+ var symSingleMatch = rem.match(/^([!@#\$%&~<>?])([A-Z])(\d+(?:\.\d+)?(?:[Ee]\d+)?)$/);
5797
+ if (symSingleMatch) {
5798
+ var ssVal = Q.fromString(symSingleMatch[2] + symSingleMatch[3]);
5799
+ ssVal.layer = (ssVal.layer || 0) +
5800
+ ("!@#$%&~<>?".indexOf(symSingleMatch[1]) + 1);
5801
+ if (negateIt) ssVal.sign = -1;
5802
+ return ssVal;
5803
+ }
5804
+
5805
+ // #20 — α + single letter (F..Z) + β: αΓβ = Γ(β + log10 α).
5806
+ // format() emits this for the sub-unit diagonal (Aa1.9 → 3.261F8).
5807
+ // E is deliberately excluded: it is scientific notation above.
5808
+ var alphaSingleMatch = rem.match(/^(\d+(?:\.\d+)?)([F-Z])(\d+(?:\.\d+)?(?:[Ee]\d+)?)$/);
5809
+ var alphaSingleSymMatch = rem.match(/^([!@#\$%&~<>?])(\d+(?:\.\d+)?)([F-Z])(\d+(?:\.\d+)?(?:[Ee]\d+)?)$/);
5810
+ if (alphaSingleMatch || alphaSingleSymMatch) {
5811
+ var alsSym = alphaSingleSymMatch ? alphaSingleSymMatch[1] : "";
5812
+ var alsAlpha = Number(alphaSingleSymMatch ? alphaSingleSymMatch[2] : alphaSingleMatch[1]);
5813
+ var alsLetter = alphaSingleSymMatch ? alphaSingleSymMatch[3] : alphaSingleMatch[2];
5814
+ var alsBeta = Number(alphaSingleSymMatch ? alphaSingleSymMatch[4] : alphaSingleMatch[3]);
5815
+ if (isFinite(alsAlpha) && alsAlpha > 0 && isFinite(alsBeta)) {
5816
+ var alsVal = Q.fromString(alsLetter + String(alsBeta + Math.log10(alsAlpha)));
5817
+ if (alsSym) {
5818
+ alsVal.layer = (alsVal.layer || 0) +
5819
+ ("!@#$%&~<>?".indexOf(alsSym) + 1);
5820
+ }
5821
+ if (negateIt) alsVal.sign = -1;
5822
+ return alsVal;
5823
+ }
5824
+ }
5825
+
5769
5826
  // #19 — the symbol layers of the Aa diagonal: every symbol adds one ω^
5770
5827
  // (!Aa<n> = 10{ω^n}10 layer 0, @Aa<n> layer 1, #Aa<n> layer 2, …), so the
5771
5828
  // same rule-3 cascade is stored and `layer` carries the extra ω^'s.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metanum",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "A javascript library that handles numbers as large as f_ε₀(9e15)",
5
5
  "main": "metanum.js",
6
6
  "files": [
@@ -76,7 +76,7 @@
76
76
  <script src="./format-metanum.js"></script>
77
77
  <script>
78
78
  // test in console
79
- // MetaNum v2.0.2
79
+ // MetaNum v2.1.1
80
80
  console.log('=== MetaNum Library by dlsdl ===');
81
81
 
82
82
  </script>
package/test_mixed.js CHANGED
@@ -2023,8 +2023,12 @@ checkFormat("20-row cascade compresses to two letter types", MetaNum.h10000(3, 1
2023
2023
  // SINGLE-letter form !αΓβ — "!" adds one ω^ layer on top of the level Γ names
2024
2024
  checkFormat("10-letter level carries to !1.000M9", MetaNum.iter(3, 10), "!1.000M9");
2025
2025
  checkFormat("5-letter level carries to !1.000H4", m3.iter(5), "!1.000H4");
2026
- checkFormat("symbol carry stacks: apix(3,10) → @1.000N10", m3.aperixxate(10), "@1.000N10");
2027
- checkFormat("symbol carry stacks: apix(3,5) → @1.000I10", m3.aperixxate(5), "@1.000I10");
2026
+ // #28: past multiLetterLimit the pure diagonal keeps the exact token instead
2027
+ // of the old single-letter carry (which did not round-trip).
2028
+ checkFormat("apix(3,10) → exact !2.000A(a×10)10", m3.aperixxate(10), "!2.000A" + "a".repeat(10) + "10");
2029
+ ok("apix(3,10) format round-trip", MetaNum(format(m3.aperixxate(10))).eq(m3.aperixxate(10)));
2030
+ checkFormat("apix(3,5) → exact !A(a×5)10", m3.aperixxate(5), "!A" + "a".repeat(5) + "10");
2031
+ ok("apix(3,5) format round-trip", MetaNum(format(m3.aperixxate(5))).eq(m3.aperixxate(5)));
2028
2032
  checkFormat("short diagonal keeps the letter form", m3.aperixxate(3), "!2.000Aaaa10");
2029
2033
  checkFormat("cascade inner α stays [1,10) (AbAa600)", "AbAa600", "Ab1.000Aa600");
2030
2034
 
@@ -2133,6 +2137,29 @@ console.log("\n=== symbol layer semantics ===");
2133
2137
  checkRT("@Aa5", "@Aa5");
2134
2138
  checkRT("#Aa5", "#Aa5");
2135
2139
  checkRT("!Ab5", "!Ab5");
2140
+
2141
+ // issue #19 residual: n=1 carries to the single-letter N10 spelling. The
2142
+ // layer prefix must survive (format → parse → eq), not parse to 0.
2143
+ function fmtRT(input) {
2144
+ var v = MetaNum(input);
2145
+ return v.eq(MetaNum(format(v)));
2146
+ }
2147
+ ok("format round-trip @Aa1 (!1.000N10)", fmtRT("@Aa1"), format(MetaNum("@Aa1")));
2148
+ ok("format round-trip #Aa1 (@1.000N10)", fmtRT("#Aa1"), format(MetaNum("#Aa1")));
2149
+
2150
+ // issue #26: non-integer multi-a markers use the exact token spelling
2151
+ // (Aaa1.5) instead of the rounded αAaaβ form (4.472Aaa1).
2152
+ ok("format round-trip @Aa1.5 (!Aaa1.5)", fmtRT("@Aa1.5"), format(MetaNum("@Aa1.5")));
2153
+ ok("format round-trip @Aa2.5 (!Aaaa2.5)", fmtRT("@Aa2.5"), format(MetaNum("@Aa2.5")));
2154
+ ok("format round-trip #Aa2.5 (@Aaaa2.5)", fmtRT("#Aa2.5"), format(MetaNum("#Aa2.5")));
2155
+
2156
+ // issue #28: past multiLetterLimit the pure diagonal keeps the exact token
2157
+ // (the old carry !1.000H10 hard-coded 10 and added a layer).
2158
+ ok("format round-trip Aaaaa3.5", fmtRT("Aaaaa3.5"), format(MetaNum("Aaaaa3.5")));
2159
+ ok("format round-trip Aaaaa5", fmtRT("Aaaaa5"), format(MetaNum("Aaaaa5")));
2160
+ ok("format round-trip Aaaaa10", fmtRT("Aaaaa10"), format(MetaNum("Aaaaa10")));
2161
+ ok("format round-trip @Aa3.5", fmtRT("@Aa3.5"), format(MetaNum("@Aa3.5")));
2162
+ ok("format round-trip #Aa3.5", fmtRT("#Aa3.5"), format(MetaNum("#Aa3.5")));
2136
2163
  })();
2137
2164
 
2138
2165
  console.log("\n=== two-letter rule ===");
@@ -2637,6 +2664,28 @@ console.log("\n=== D06 !alpha Aa beta ===");
2637
2664
  ok("round-trip !Aa2.5 (approx)", rtApprox("!Aa2.5", 1e-2));
2638
2665
  ok("round-trip !1Aa1.5 (approx)", rtApprox("!1Aa1.5", 1e-2));
2639
2666
  ok("round-trip !Aa0.5 (approx)", rtApprox("!Aa0.5", 1e-2));
2667
+ // issue #20 residual: x∈[1,2) sometimes formats as αΓβ with a single
2668
+ // letter F..Z (Aa1.65 → 4.935F5). Those used to parse to 0; the αΓβ
2669
+ // branch now reads them back, and the 4-digit mantissa is checked in slog
2670
+ // space (equivalent to the tolerance allowed by the acceptance criteria).
2671
+ function slogClose(input, tol) {
2672
+ var v = MetaNum(input);
2673
+ var back = MetaNum(format(v));
2674
+ var d = Number(v.slog(10).toString()) - Number(back.slog(10).toString());
2675
+ return Math.abs(d) <= tol;
2676
+ }
2677
+ ok("format(Aa1.65) = 4.935F5, slog round-trip",
2678
+ format(MetaNum("Aa1.65")) === "4.935F5" && slogClose("Aa1.65", 1e-3), format(MetaNum("Aa1.65")));
2679
+ ok("format(Aa1.95) = 1.686F9, slog round-trip",
2680
+ format(MetaNum("Aa1.95")) === "1.686F9" && slogClose("Aa1.95", 1e-3), format(MetaNum("Aa1.95")));
2681
+ ok("3.261F8 parses (not 0)", MetaNum("3.261F8").neq(0), MetaNum("3.261F8").toString());
2682
+ var bad20 = [];
2683
+ for (var xi = 105; xi <= 195; xi += 10) {
2684
+ var s20 = "Aa" + (xi / 100).toFixed(2);
2685
+ if (!slogClose(s20, 1e-3)) bad20.push(s20);
2686
+ }
2687
+ ok("Aa1.05..Aa1.95 all format round-trip in slog space",
2688
+ bad20.length === 0, bad20.join(","));
2640
2689
  // smooth (non-integer) family stays monotone inside the compact forms
2641
2690
  ok("!Aa1.5 < !Aa2.5 < !Aa3.5",
2642
2691
  MetaNum("!Aa1.5").lt(MetaNum("!Aa2.5")) && MetaNum("!Aa2.5").lt(MetaNum("!Aa3.5")));