dotnet / dotnet/dotnet-api-docs
Double and float round-trip string format confusion
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
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
Contributor guide
Assessment
This issue has not been assessed yet.