feat: add strict numeric stdlib functions - #56
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds strict numeric standard-library functions (abs, sum, min, and max) with finite-number validation, tests, RFC updates, and regenerated multilingual manuals. This PR is stacked on #55.
Changes:
- Adds strict numeric built-ins and boundary coverage.
- Extends qtest and Rust tests.
- Updates RFCs, syntax documentation, and five multilingual manuals.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/scripts/stdlib.qc |
Extends executable standard-library coverage. |
tests/rfc_core.rs |
Tests numeric behavior and error cases. |
src/vm.rs |
Implements numeric built-ins and validation. |
RFCs/0113-numeric-standard-library.md |
Defines numeric function semantics. |
RFCs/0001-language-core.md |
Updates the built-in function inventory. |
RFCs/0000-project-scope.md |
Registers RFC 0113. |
README.md |
Links the latest RFC. |
manuals/manual.zh-CN.qc |
Updates the Chinese manual source. |
manuals/manual.latin.qc |
Updates the Latin manual source. |
manuals/manual.en.qc |
Updates the English manual source. |
manuals/manual.devanagari-sa.qc |
Updates the Devanagari manual source. |
manuals/manual.classical-zh.qc |
Updates the classical Chinese manual source. |
docs/syntax.zh-CN.md |
Documents numeric built-ins in Chinese. |
docs/syntax.en.md |
Documents numeric built-ins in English. |
docs/manual.zh-CN.md |
Regenerated Chinese manual. |
docs/manual.zh-CN.html |
Regenerated Chinese HTML manual. |
docs/manual.latin.md |
Regenerated Latin manual. |
docs/manual.latin.html |
Regenerated Latin HTML manual. |
docs/manual.en.md |
Regenerated English manual. |
docs/manual.en.html |
Regenerated English HTML manual. |
docs/manual.devanagari.sa.md |
Regenerated Devanagari manual. |
docs/manual.devanagari-sa.html |
Regenerated Devanagari HTML manual. |
docs/manual.classical-zh.md |
Regenerated classical Chinese manual. |
docs/manual.classical-zh.html |
Regenerated classical Chinese HTML manual. |
Suppressed comments (2)
tests/rfc_core.rs:1344
- RFC 0000 (RFCs/0000-project-scope.md:21) requires every runtime addition to include a bytecode-verification test. This test only executes the new functions through
Context::eval, so a verifier regression affecting programs containing these calls would not be covered. Add acompile(...).verify()assertion covering the new call forms.
fn numeric_standard_library_is_strict_and_total() {
tests/rfc_core.rs:1367
- The finite-input contract includes both infinities, but this host-boundary test injects only NaN. A regression that removes the
is_finite()guard forf64::INFINITYorf64::NEG_INFINITYwould still pass; add both infinity cases to verify thatabsand the aggregators reject all non-finite host numbers.
host.set_global("nan", Value::Number(f64::NAN));
assert!(host.eval("abs(nan)").is_err());
assert!(host.eval("sum([nan])").is_err());
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Base automatically changed from
feat/qbench-selection
to
chore/release-test-gate
August 22, 2026 17:48
Base automatically changed from
chore/release-test-gate
to
test/qtest-stdlib-showcase
August 22, 2026 17:49
Base automatically changed from
test/qtest-stdlib-showcase
to
chore/msrv-contract
August 22, 2026 17:49
tiye
force-pushed
the
feat/stdlib-numeric-functions
branch
from
August 22, 2026 18:07
1784c57 to
a212a66
Compare
tiye
force-pushed
the
chore/msrv-contract
branch
from
August 22, 2026 18:08
a18671b to
73b0533
Compare
tiye
force-pushed
the
feat/stdlib-numeric-functions
branch
from
August 22, 2026 18:31
a212a66 to
6b6ba36
Compare
tiye
force-pushed
the
chore/msrv-contract
branch
2 times, most recently
from
August 22, 2026 18:34
ba62c10 to
6528d38
Compare
tiye
force-pushed
the
feat/stdlib-numeric-functions
branch
from
August 22, 2026 18:35
6b6ba36 to
6d95923
Compare
tiye
force-pushed
the
chore/msrv-contract
branch
from
August 22, 2026 18:52
6528d38 to
271321b
Compare
tiye
force-pushed
the
feat/stdlib-numeric-functions
branch
from
August 22, 2026 18:53
6d95923 to
b55fd9b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
abs,sum,min, andmaxwithout prototype or implicit conversion semanticsValidation
make docsmake checkThis PR is stacked on PR #55 and is intentionally not merged independently.