Merge branch 'next' into issue-7-webhook-delivery
check / check (push) Successful in 1m33s

Brings in the exact results past the range of a double. docs/TODO.md
conflicted: both Completed Steps lines are kept, the newer one first.

Model: opus-5-5
This commit is contained in:
2026-09-29 07:58:01 +00:00
5 changed files with 140 additions and 44 deletions
+17 -10
View File
@@ -478,16 +478,23 @@ container.
refused, exact powers are capped, and every number is held as a
fraction, whole numbers too, under the 4096-bit limit below, so a
message cannot make the bot do unbounded work. Whole numbers below
10<sup>21</sup> are written exactly; other results in the shortest
form that reads back as the same double, in exponent notation from
10<sup>21</sup> up and below 10<sup>-6</sup>. Refused as too large or
too small: any number whose numerator or denominator reaches 4096
bits, wherever it appears, as `go/constant` rounds a fraction that
grows that large (`1e-1300 + 1`); a power computed as a double whose
base or result is outside the normal range of a double, about 2.2e-308
to 1.8e308 in magnitude, where a double keeps all its digits
(`1e-400^0.5`); and a result other than zero outside that range, as it
is written through a double (`1e400`, `2^-1400`).
10<sup>21</sup> are written exactly. Other results inside the normal
range of a double, about 2.2e-308 to 1.8e308 in magnitude, where a
double keeps all its digits, are written in the shortest form that
reads back as the same double, in exponent notation from
10<sup>21</sup> up and below 10<sup>-6</sup>. Results outside that
range are written from their exact value in exponent notation, rounded
to 17 significant digits, the most the shortest form of a double
takes, with trailing zeros dropped: `2^1200` is
`1.7218479456385751e+361`, `10^400` is `1e+400` and `2^-1074` is
`4.9406564584124654e-324`. Refused as too large or too small: any
number whose numerator or denominator reaches 4096 bits, wherever it
appears, as `go/constant` rounds a fraction that grows that large
(`2^4095`, `1e-1300 + 1`); and a power computed as a double whose
result is outside the normal range of a double (`2^1500.5`). The base
of such a power may be outside that range: square roots taken from its
exact value bring it inside first, so `(2^1200)^0.5` is
`4.149515568880993e+180` and `1e-400^0.5` is `1e-200`.
- **Failure is an exit.** If the chat client exits or the connection to
it drops, the bot exits with an error and the container's restart
policy starts both again. `SIGTERM` stops the bot, which stops the