Skip to content

Output of fmt doesn't match C's printf for 'g' #1376

@Queueless

Description

@Queueless

I'm replacing a home grown safe format library with fmt and here is a test case where the output doesn't match:

sprintf("%g", 0.000000456) -> 4.56e-07
fmt::sprintf("%g", 0.000000456) -> 4.56000e-07

I found that FMT_USE_GRISU set to zero fixes my problem, so this algorithm appears to not generate equivalent output.

Metadata

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