Skip to content

Support single precision floats in grisu formatting #1336

Closed
@orivej

Description

Currently fmt::format("{}", 0.1f) with grisu produces 0.10000000149011612 (as would have been expected from double(0.1f)) rather than 0.1.

Single precision formatting differs from double precision only in the calculation of the boundaries: https://github.com/google/double-conversion/blob/v3.1.5/double-conversion/fast-dtoa.cc#L525-L536

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions