Skip to content

Double and float round-trip string format confusion #9320

Open
@ptasev

Description

@ptasev

The following article mentions that instead of using the round-trip specifier R for double and float, G17 and G9 should be used respectively. It also mentions the R specifier may be slower than G17. However, according to a blog post about .NET Core 3.1, this has since been fixed. Can we get some clarification on whether G17 is still the recommendation?

Docs mentioning not to use R:
https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#round-trip-format-specifier-r
https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#standard-format-specifiers

Blog post:
https://devblogs.microsoft.com/dotnet/floating-point-parsing-and-formatting-improvements-in-net-core-3-0/#making-the-parser-ieee-compliant

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions