Skip to content

Use faster Erlang float.to_string implementation - #948

Merged
lpil merged 1 commit into
gleam-lang:mainfrom
arconyx:push-kzrwzlpmqnuo
Sep 15, 2026
Merged

lpil merged 1 commit into
gleam-lang:mainfrom
arconyx:push-kzrwzlpmqnuo

Conversation

@arconyx

@arconyx arconyx commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Replace the Erlang implementation of float.to_string with a version that calls erlang:float_to_binary(Float, [short]). This removes a transformation from list to binary and performs faster in tests. See #947 for details.

The short option is used to match io_lib_format:fwrite_g(Float), which calls float_to_list(Float, [short]).

@lpil lpil left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love little improvements like these! Nice work, thank you!!

P.S. jj spotted 馃憖

@lpil
lpil merged commit d06147c into gleam-lang:main Sep 15, 2026
7 checks passed
@arconyx
arconyx deleted the push-kzrwzlpmqnuo branch September 15, 2026 09:56
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.

2 participants