Skip to content

fix: align Lua 5.2 numeric coercion and math selection - #380

Merged
akeit0 merged 2 commits into
mainfrom
codex/pr-lua52-numeric-coercion
Oct 27, 2026
Merged

akeit0 merged 2 commits into
mainfrom
codex/pr-lua52-numeric-coercion

Conversation

@akeit0

@akeit0 akeit0 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Use Lua numeral rules and a single digit-accumulation loop for explicit-base tonumber. For example, tonumber('1.5',10) returns nil and tonumber(10,2) returns 2. Preserve the current managed number-to-text conversion for numeric inputs.

Align select's count/range rules, min/max's NaN and signed-zero selection, optional-nil/base-zero logarithms, and random's argument handling. Accept fractional bit32 words through the existing managed normalizer.

Tests cover malformed and valid numerals, bases, selection, logarithm edges, random bounds and bit32 coercion. The full test suite passes on .NET 8/10; CSharpier passes.

@akeit0
akeit0 force-pushed the codex/pr-lua52-vm-semantics branch from 01a99b1 to e5b1f96 Compare October 27, 2026 02:56
@akeit0
akeit0 force-pushed the codex/pr-lua52-numeric-coercion branch 2 times, most recently from 10f4662 to f7bd5df Compare October 27, 2026 03:11
@akeit0
akeit0 force-pushed the codex/pr-lua52-vm-semantics branch from e5b1f96 to 737ab3f Compare October 27, 2026 03:11
@akeit0
akeit0 changed the base branch from codex/pr-lua52-vm-semantics to main October 27, 2026 03:28
@akeit0
akeit0 marked this pull request as ready for review October 27, 2026 03:28
@akeit0
akeit0 force-pushed the codex/pr-lua52-numeric-coercion branch from f7bd5df to 8aa7108 Compare October 27, 2026 03:28
@akeit0
akeit0 merged commit dea26e1 into main Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant