Skip to content

Floating-point numbers are uglified, a.k.a. write shortest floating-point representation with round-trip guarantee #1289

@Anton3

Description

@Anton3

In the last few years, libraries like fmt have mastered printing of floating-point numbers. They use shortest representation with round-trip guarantee.

Meanwhile, yaml-cpp, after #649, started to uglify numbers in my configs (I use yaml-cpp to patch them).

For example, before:

latitude: 34.34
longitude: 56.56
altitude: 12.12
heading: 78.78

After:

latitude: 34.340000000000003
longitude: 56.560000000000002
altitude: 12.119999999999999
heading: 78.780000000000001

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions