summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-09-09 11:52:36 -0400
committerpommicket <pommicket@gmail.com>2025-09-09 11:52:36 -0400
commitaefecd6b6a923643bf6ee6e519804d9688803516 (patch)
treeb0380483c0900763c77b80b67386f59b4730e2f3
parentfd62eaa814609835c87df5f24633760552ce64ea (diff)
Reduce integer limit to 2^53-1
-rw-r--r--site/spec.html32
-rw-r--r--tests/interpretation/int.pom18
-rw-r--r--tests/interpretation/uint.pom9
3 files changed, 34 insertions, 25 deletions
diff --git a/site/spec.html b/site/spec.html
index f3178fd..805dcd1 100644
--- a/site/spec.html
+++ b/site/spec.html
@@ -470,23 +470,29 @@ and for my.nephews.car.id is String (no schema key matches, so the default of St
<li><code>String</code> — accepts any value</li>
<li><code>None</code> — accepts an unset value (special—see below)</li>
<li><code>Empty</code> — accepts an empty value</li>
- <li><code>Bool</code> — accepts <code>true</code>, <code>on</code>, <code>yes</code>,
- <code>false</code>, <code>off</code>, <code>no</code> (case- and white space- sensitive).</li>
- <li><code>UInt</code> — accepts any unsigned integer strictly less than 2<sup>63</sup>,
+ <li>
+ <code>Bool</code> — accepts <code>true</code>, <code>on</code>, <code>yes</code>,
+ <code>false</code>, <code>off</code>, <code>no</code> (case- and white space- sensitive).
+ </li>
+ <li>
+ <code>UInt</code> — accepts any unsigned integer strictly less than 2<sup>53</sup>,
written in decimal or <code>0x</code> or <code>0X</code>-prefixed hexadecimal.
A leading <code>+</code> is permitted, but <code>-0</code> is not.
Leading zeroes are not permitted for decimal integers.
White space around the integer is not permitted.
- Only 63 bits are allowed to support languages (Java) with no 64-bit unsigned integers.</li>
- <li><code>Int</code> — accepts any (two’s complement) signed integer whose absolute value
- is strictly less than 2<sup>63</sup>
- (NB: <code>INT64_MIN</code>/−2<sup>63</sup> is not allowed),
- written in decimal or <code>0x</code> or <code>0X</code>-prefixed hexadecimal.
+ Only 53 bits are allowed to support languages (JavaScript) with
+ a double type, but no 64-bit integer type.
+ </li>
+ <li>
+ <code>Int</code> — accepts any signed integer whose absolute value
+ is strictly less than 2<sup>53</sup>, written in decimal or
+ <code>0x</code> or <code>0X</code>-prefixed hexadecimal.
Leading zeroes are not permitted for decimal integers.
White space around the integer is not permitted.
- A leading <code>+</code> (or, of course, <code>-</code>) is permitted.</li>
- <li><code>Float</code> —
- A floating-point number, written in ordinary decimal
+ A leading <code>+</code> (or, of course, <code>-</code>) is permitted.
+ </li>
+ <li>
+ <code>Float</code> — A floating-point number, written in ordinary decimal
(e.g. <code>-1.234</code>, <code>7.</code>, <code>265</code>) or in scientific notation
(e.g. <code>3e5</code>, <code>3.E-5</code>, <code>-3.7e+5</code>).
Excessive leading zeroes are not permitted (<code>0.0</code> is allowed, but not <code>00.0</code>).
@@ -633,7 +639,7 @@ and for my.nephews.car.id is String (no schema key matches, so the default of St
<code>get_int(conf: Configuration, key: String) -&gt; Optional&lt;Int&gt;</code><br>
<code>get_int_or_default(conf: Configuration, key: String, default: Int) -&gt; Int</code><br>
Get value associated with <code>key</code>,
- if any exists, and parse it as a signed 64-bit integer,
+ if any exists, and parse it as a signed integer,
following the <code>Int</code> schema type described above
(returning <code>default</code> if the key doesn’t exist).
Returns an error if the key exists but its value is not a valid signed 64-bit integer.
@@ -642,7 +648,7 @@ and for my.nephews.car.id is String (no schema key matches, so the default of St
<code>get_uint(conf: Configuration, key: String) -&gt; Optional&lt;UInt&gt;</code><br>
<code>get_uint_or_default(conf: Configuration, key: String, default: UInt) -&gt; UInt</code><br>
Get value associated with <code>key</code>, if any exists,
- and parse it as an unsigned 63-bit [sic] integer,
+ and parse it as an unsigned integer,
following the <code>UInt</code> schema type described above
(returning <code>default</code> if the key doesn’t exist).
Returns an error if the key exists but its value is not a valid unsigned 63-bit integer.
diff --git a/tests/interpretation/int.pom b/tests/interpretation/int.pom
index 7158dc2..f2f6243 100644
--- a/tests/interpretation/int.pom
+++ b/tests/interpretation/int.pom
@@ -24,11 +24,11 @@ hex.b = 74751
negative_hex.a = -0Xfade
negative_hex.b = -64222
-largest.a = 9223372036854775807
-largest.b = 0x7fffffffffffffff
+largest.a = 9007199254740991
+largest.b = 0x1fffffffffffff
-smallest.a = -9223372036854775807
-smallest.b = -0x7fffffffffffffff
+smallest.a = -9007199254740991
+smallest.b = -0x1fffffffffffff
[bad]
space_three = " 3"
@@ -41,7 +41,9 @@ multi_sign = -+3
multi_sign2 = +-3
multi_sign3 = ++3
multi_sign4 = --3
-too_large = 9223372036854775808
-too_large_hex = 0x8000000000000000
-too_small = -9223372036854775808
-too_small_hex = -0x8000000000000000
+too_large = 9007199254740992
+too_large_hex = 0x20000000000000
+much_too_large = 9999999999999999
+too_small = -9007199254740992
+too_small_hex = -0x20000000000000
+much_too_small = -9999999999999999
diff --git a/tests/interpretation/uint.pom b/tests/interpretation/uint.pom
index be15211..e762022 100644
--- a/tests/interpretation/uint.pom
+++ b/tests/interpretation/uint.pom
@@ -21,8 +21,8 @@ hex.b = 74751
hex2.a = 0Xfade
hex2.b = 64222
-largest.a = 9223372036854775807
-largest.b = 0x7fffffffffffffff
+largest.a = 9007199254740991
+largest.b = 0x1fffffffffffff
[bad]
space_three = " 3"
@@ -33,6 +33,7 @@ trailing_dec = 35a
trailing_hex = 0x35g
decimal = 3.0
multi_sign = ++3
-too_large = 9223372036854775808
-too_large_hex = 0x8000000000000000
+too_large = 9007199254740992
+too_large_hex = 0x20000000000000
+much_too_large = 9999999999999999
negative_zero = -0