Submitter: Bill Plauger (US)
Submission Date: 2000-04-10
Reference Document: N/A
Date: 2001-09-18 16:08:44
Subject: strtod, strtof and strtold expected form of the subject sequence.
In <stdlib.h>, functions strtod, strtof, and strtold should permit an implementation to recognize either inf or infinity, and either nan or nan(n-char-sequenceopt ), not just one of each.
Suggested Technical Corrigendum
In 188.8.131.52 replace:
- one of INF or INFINITY, ignoring case
- one of NAN or NAN(n-char-sequenceopt ), ignoring case in the NAN part, where:
- either INF not followed by I, or INFINITY, ignoring case
- either NAN not followed by a left parenthesis, or NAN(n-char-sequenceopt ), ignoring case in the NAN part, where:
Committee Discussion (for history only)
For the functions strtod, strtof and strtold, should the implementation allow INFI to work as INF and leave the pointer at the next I, or should it reject a sequence such as INFINF as an invalid sequence, that failed at the second F.
The issue concerns what degree of pushback is necessary. But these are string functions, not input functions, so they do not need push back. Furthermore, 184.108.40.206¶9 and the associated footnote, clearly indicates that there is no requirement for the strto* functions to retain symmetric functionality with fscanf, indeed that is noted as being explicitly different.
It was noted that while symmetry with scanf may have some attractiveness, that the strto* functions cannot report that the input string did not match (no error mechanism exists) and that it would just return ZERO. With scanf the error is reported.
However, the issue in the DR really reduces to the use of the term one of on the bullets in 220.127.116.11¶3. The discussion indicated we were in agreement with Clive Feather's comments on this DR.
It was also observed that these changes also apply to the wcsto* functions in 18.104.22.168
Remove the words 'one of' from the third and fourth bullets of 22.214.171.124¶3.
Remove the words 'one of' from the third and fourth bullets of 126.96.36.199¶3.
Previous Defect Report < - > Next Defect Report