Title
is whitespace allowed between `-' and a digit?
Status
cd1
Section
[locale.categories]
Submitter
Martin Sebor

Created on 2001-09-17.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

It's not clear whether the format described in [locale.numpunct] paragraph 2 has any normative weight: nothing in the standard says how, or whether, it's used. However, there's no reason for it to differ gratuitously from the very specific description of numeric processing in [facet.num.get.virtuals]. The proposed resolution removes all mention of "whitespace" from that format.

Date: 2010-10-21.18:28:33

Proposed resolution:

Change the first part of [locale.numpunct] paragraph 2 from:

The syntax for number formats is as follows, where digit represents the radix set specified by the fmtflags argument value, whitespace is as determined by the facet ctype<charT> (22.2.1.1), and thousands-sep and decimal-point are the results of corresponding numpunct<charT> members. Integer values have the format:

  integer   ::= [sign] units
  sign      ::= plusminus [whitespace]
  plusminus ::= '+' | '-'
  units     ::= digits [thousands-sep units]
  digits    ::= digit [digits]

to:

The syntax for number formats is as follows, where digit represents the radix set specified by the fmtflags argument value, and thousands-sep and decimal-point are the results of corresponding numpunct<charT> members. Integer values have the format:

  integer   ::= [sign] units
  sign      ::= plusminus
  plusminus ::= '+' | '-'
  units     ::= digits [thousands-sep units]
  digits    ::= digit [digits]
Date: 2001-09-17.00:00:00

From Stage 2 processing in [facet.num.get.virtuals], p8 and 9 (the original text or the text corrected by the proposed resolution of issue 221) it seems clear that no whitespace is allowed within a number, but [locale.numpunct], p2, which gives the format for integer and floating point values, says that whitespace is optional between a plusminus and a sign.

The text needs to be clarified to either consistently allow or disallow whitespace between a plusminus and a sign. It might be worthwhile to consider the fact that the C library stdio facility does not permit whitespace embedded in numbers and neither does the C or C++ core language (the syntax of integer-literals is given in [lex.icon], that of floating-point-literals in [lex.fcon] of the C++ standard).

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2277
2010-10-21 18:28:33adminsetmessages: + msg2276
2001-09-17 00:00:00admincreate