Skip to content

Fix Macro.to_string/1 for large negative integers #12326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

sabiwara
Copy link
Contributor

@sabiwara sabiwara commented Jan 9, 2023

Closes #12325

Note: this bug didn't affect quoted negative integers, hence the extra test:

iex(1)> Macro.to_string(quote do: -576_460_752_303_423_455)
"-576_460_752_303_423_455"
iex(2)> Macro.to_string(-576_460_752_303_423_455)
"-_576_460_752_303_423_455"

@sabiwara sabiwara force-pushed the 12325-bug-negative-integer-format branch from 332392b to 2f3feec Compare January 9, 2023 23:54
@josevalim josevalim merged commit 6f7c472 into elixir-lang:main Jan 10, 2023
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@sabiwara sabiwara deleted the 12325-bug-negative-integer-format branch January 10, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Macro.to_string prepends underscore for negative large numbers.
2 participants