Reference Link: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2849.pdf
I am trying to gather information about TR2 and how it relates to the upcoming C++ Standard, if it does at all.
Here are my questions so far. If I've missed any important questions, please answer those as well. :)
Preliminaries:
- The current C++ Standard is silent on the acutual binary representation of floating-point values. All it says is that floating point representation is "implementation defined." In practice, every implementation I'm aware of uses IEEE 754-2008. But this is not a requirement of the Standard.
- TR2 identifies new types to be added to the language:
decimal32
,decimal64
, anddecimal128
.
Questions/Points For Comment:
- Are the new types above (
decimal64
etc) going to be native to the language, or provided in a library? - Do the new types do anything to resolve the issue of floating-point imprecision? If so, how?
- Does TR2 mandate a specific binary representation for these (or any) types?
- Is TR2 going to be accepted as part of an upcoming C++ Standard? If so, when?
- Is an implementation of these new types available in any currently-available library (eg, Boost)?
FYI, the linked document isn't TR2. "TR2" refers to a set of library extensions, in the same style as TR1, while the draft for "decimal floating point arithmetic extensions" is just that. There is no TR2 draft yet and it was originally planned to come out after 0x. So from here on, I'll assume that you aren't asking about TR2, but the linked document.
std::decimal
which could easily wrap a native type provided by the platform/implementation. This TR does not define decimal literals.std::decimal::decimal32
, 64, and 128. Refer to thedecimalN
links in the table here.