-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Thanks to @tiehuis's work in #1958, #375 is closed and zig has basic float parsing in the standard library. But as he notes, there are the following deficiencies:
- it doesn't handle some edge cases
- error behavior is not zig-idiomatic
- handling the edge cases might require an allocator
- does not handle hex floats
I did a proof of concept of porting musl's float parsing code to implement f128 parsing in stage1. You can see this implementation in parse_f128.c. I believe that further porting this code to the Zig standard library would check all the above boxes.
This issue is the "deserialization" side of #1181. Note the goal stated in #1181 (comment):
I would like to propose that the default float printing and default float parsing in Zig should have roundtrip bit-for-bit value preservation for all values for all float types.
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.