18

What is the current status of decimal floating point in C++? I am specifically looking for the status of language inclusion, standards compliance and portability.

There are a host of "official" libraries floating around which are based on existing standards (notably IEEE754-2008) which have been heralded as the groundwork for standards inclusion:

Additionally, there was a proposal to add decimal floats to C++14. According to the proposer in this post it was not submitted in time for inclusion (see comments on answer).

I have also checked numerous sources for C++17 features, but I cannot find mention of Decimal Floating Point.

I know that some compilers (such as GCC and Clang) have implemented their own extensions based on what they believe the spec will look like. However, these extensions obviously cannot offer full support / portability for a spec that has not been officially ratified yet (as far as I am aware).

Where are we in August of 2017 on official decimal floating point support?

MysteryMoose
  • 2,041
  • 4
  • 21
  • 41
  • is this even on topic? If it isn't I'm not even sure what exchange site this would go under. – Krupip Aug 07 '17 at 17:22
  • 3
    @snb Certainly not at any meta-site. And I think the question is _on-topic_. – user0042 Aug 07 '17 at 17:23
  • 5
    @snb It's relevant to programming and feasibly answerable, so I'd say it's on topic. – hnefatl Aug 07 '17 at 17:23
  • 1
    According to [this](https://cplusplus.github.io/LWG/lwg-proposal-status.html) there is no status for N3407 – NathanOliver Aug 07 '17 at 17:57
  • 2
    As far as I can tell, that document was last updated in 2013. Has there really been no progress since then? – MysteryMoose Aug 07 '17 at 18:02
  • @phobos51594 Oh, didn't see that. You can get a more current list [here](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/#Post-C++11). That said I did find [this](https://wongmichael.com/category/c/) that says more than likely it will be a no. I'm trying to find something more concrete. – NathanOliver Aug 07 '17 at 18:14

1 Answers1

8

C++17 is feature-complete at this point, and going out for the final vote. So whatever is there right now is what's going to be in it when the final ISO vote is made, modulo bugs/defects of course.

Decimal floats were not voted in, so they're not going to be in C++17. The last paper on the subject, N3871, was written in 2014. So it seems clear that nobody's really trying to move it forward.

Nicol Bolas
  • 378,677
  • 53
  • 635
  • 829
  • 2
    They are probably waiting for the final iterations of the C Decimal TS, for which there has been extensive work. Some parts of it (the ones that may be adaopted in C++) target the next C standard revision, C2x. – Morwenn Aug 08 '17 at 11:39
  • 1
    @Morwenn: actually, I'm not really waiting for anything although I will probably have a look at the C Decimal TS if I get to work on a proposal for inclusion into C++. Essentially, I don't manage to work on the proposal. – Dietmar Kühl Aug 09 '17 at 17:01
  • @DietmarKühl I'm almost disappointed it's not actually a subtle plan to incorporate all the work of the C TS to get decimal floating point numbers in the standard with flying colors D: – Morwenn Aug 10 '17 at 08:03