The Principia Machina/TPC-PY/vectors/canon corpus.json: Difference between revisions
Appearance
TPC-PY source vectors/canon_corpus.json (0.1.0), SHA-256 ef5e6716c7feb119; conformed TPS 0.3.0; PROPOSED, not declared (CO-8) |
m 1 revision imported |
||
(No difference)
| |||
Latest revision as of 04:37, 28 September 2026
{
"meta": {
"name": "tpc_canon_corpus",
"version": "0.1.0",
"status": "VERIFIED (both residences)",
"module": "tpc_strike canon (float form rebuilt 2026-09-22)",
"note": "canon() writes a double as C printf %.12g. PHP's sprintf('%.12g') writes exponents differently ('2.0e-9' for '2e-09'), so both residences build the string from the digits of %.11e. -0.0 is written 0. Both residences MUST reproduce every expect."
},
"cases": [
{"id": "float/00", "fn": "canon", "input": {"x": 2.5}, "expect": "2.5"},
{"id": "float/01", "fn": "canon", "input": {"x": 3.0}, "expect": "3"},
{"id": "float/02", "fn": "canon", "input": {"x": 0.1}, "expect": "0.1"},
{"id": "float/03", "fn": "canon", "input": {"x": 0.3333333333333333}, "expect": "0.333333333333"},
{"id": "float/04", "fn": "canon", "input": {"x": 0.0001}, "expect": "0.0001"},
{"id": "float/05", "fn": "canon", "input": {"x": 1e-05}, "expect": "1e-05"},
{"id": "float/06", "fn": "canon", "input": {"x": 2e-09}, "expect": "2e-09"},
{"id": "float/07", "fn": "canon", "input": {"x": -2.5e-07}, "expect": "-2.5e-07"},
{"id": "float/08", "fn": "canon", "input": {"x": 123456789012.5}, "expect": "123456789012"},
{"id": "float/09", "fn": "canon", "input": {"x": 1000000000000.0}, "expect": "1e+12"},
{"id": "float/10", "fn": "canon", "input": {"x": 1.5e+300}, "expect": "1.5e+300"},
{"id": "float/11", "fn": "canon", "input": {"x": 5e-324}, "expect": "4.94065645841e-324"},
{"id": "float/12", "fn": "canon", "input": {"x": -0.0}, "expect": "0"},
{"id": "float/13", "fn": "canon", "input": {"x": 0.0}, "expect": "0"},
{"id": "float/14", "fn": "canon", "input": {"x": -1e-300}, "expect": "-1e-300"},
{"id": "float/15", "fn": "canon", "input": {"x": 9.999999999995}, "expect": "9.99999999999"},
{"id": "float/16", "fn": "canon", "input": {"x": 1.7976931348623157e+308}, "expect": "1.79769313486e+308"}
]
}