Add combinatorics functions and base-suffixed logs to the math expression parser, and rework its constants - #4559
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 16 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Adds the unary plus operator, the `true` and `false` constants, the `choose` and `pick` combinatorics functions, base-suffixed `logN`/ `rootN` function names with optional underscores and fractional bases like `log3.25`, the typeset operator spellings (`−`, `×`, `⋅`, `÷`, `∧`, `∨`, `¬`), and `Value` accessors reading results as `f32` and the standard integer types. Constants match their lowercase spelling exactly, since uppercase-initial names are reserved for matrices. The `¬` spelling is the prefix logical not alone, never the postfix factorial that `!` also spells, and punctuation never begins a name, which leaves `#`, `$`, `~`, and `@` free to become namespace prefixes once a host scope needs them. Retires the `√` prefix operator, which is untypeable and duplicates `sqrt()`, and removes the undocumented unitless `G` constant: its 9.80665 is the value of lowercase-g standard gravity under capital-G's name, and gravity's proper home is the future unit system's `g` acceleration unit. Also covers the previously untested interaction between implicit multiplication and unary minus with parenthesized operands (`2 (-3)`, `-3(2)`) in the test suite.
Keavon
force-pushed
the
math-parser-gaps
branch
from
September 21, 2026 03:57
f21fea8 to
080c998
Compare
This branch was successfully deployed
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.
−,×,⋅,÷,∧,∨, and¬.chooseandpickcombinatorics functions, plus base-suffixedlogN/rootNnames with optional underscores and fractional bases likelog3.25.trueandfalsejoin the set,infinityspells out alongsideinfand∞, and each constant now matches its lowercase spelling exactly, which keeps uppercase-initial names reserved for matrices. Removes the unitlessG.√prefix operator, which is untypeable and duplicatessqrt().Valueaccessors that read a result asf32or as any standard integer type, rounded to the nearest whole number, so host nodes stop hand-rolling those conversions.Partly closes #2026