Skip to content

std.fmt.formatFloat: implement 32-bit and 64-bit ryu backends #19264

Closed
@tiehuis

Description

@tiehuis

The ryu floating point formatting algorithm was recently added to std. This implemented only the 128-bit backend, which we use to print all floating point values: #19229

We should also consider implementing the 32-bit and 64-bit backends. At minimum, the 64-bit backend is valuable as it is much faster and reduces the large need for fast 128-bit integer support to make use of the existing backend. The 32-bit backend may be more valuable for smaller code-size specifically for embedded targets.

Upstream reference can be found at: https://github.com/ulfjack/ryu
An old (but outdated) implementation can be found at: https://github.com/tiehuis/zig-ryu

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions