This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.
Section: 26.4.2 [category.numeric] Status: NAD Submitter: Howard Hinnant Opened: 2001-10-13 Last modified: 2016-02-10
Priority: Not Prioritized
View all issues with NAD status.
When both grouping and showbase are active and the basefield is octal, does the leading 0 participate in the grouping or not? For example, should one format as: 0,123,456 or 0123,456?
An analogy can be drawn with hexadecimal. It appears that 0x123,456 is preferred over 0x,123,456. However, this analogy is not universally accepted to apply to the octal base. The standard is not clear on how to format (or parse) in this manner.
Insert into 18.104.22.168.2 [facet.numpunct.virtuals] paragraph 3, just before the last sentence:
The leading hexadecimal base specifier "0x" does not participate in grouping. The leading '0' octal base specifier may participate in grouping. It is unspecified if the leading '0' participates in formatting octal numbers. In parsing octal numbers, the implementation is encouraged to accept both the leading '0' participating in the grouping, and not participating (e.g. 0123,456 or 0,123,456).
The current behavior may be unspecified, but it's not clear that it matters. This is an obscure corner case, since grouping is usually intended for the benefit of humans and oct/hex prefixes are usually intended for the benefit of machines. There is not a strong enough consensus in the LWG for action.