Skip to content

Fix NumbersToExpressions on Lua 5.4 - #253

Open
prostone4 wants to merge 1 commit into
prometheus-lua:masterfrom
prostone4:fix-numbers-lua54
Open

prostone4 wants to merge 1 commit into
prometheus-lua:masterfrom
prostone4:fix-numbers-lua54

Conversation

@prostone4

@prostone4 prostone4 commented Oct 30, 2026 •

Copy link
Copy Markdown

On Lua 5.4, NumbersToExpressions can generate numbers that break on Lua 5.1/LuaJIT/Luau, and can crash.

  • Addition/Subtraction/Modulo: reject values that are not finite or are ≥ 2^53, and Modulo rejects rhs == 0
  • Scientific format: only used if it gives back the exact value
  • Binary format: math.floor(n % 2) so digits aren't 1.0

This branch has not been deployed

No deployments
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