<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Feedback from the C committee urged the following changes to our draft TS Part 1:<div><br></div><div><ul><li>Allow freestanding implementations to conform. </li><li>Guard library interfaces with a WANT macro.</li><li>In Table 1 add a column (or two) with forward references (clause numbers) for the C operations in the row. (The current order in the table seemed ok.)</li><li>Distinguish text in (and proposed for) the C standard from other text in the TS, by indentation (or some other means).</li><li>Find a better way to specify function calls that are affected by constant rounding modes. One approach is to list potentially affected functions (in a table) and have their invocations be affected if macro replacement has not been suppressed. This approach seemed promising after review by interested committee members.</li></ul><div>I've done the last four in my copy of our working draft, which I'll post for review soon. </div><div><br></div><div>A key issue for the first one is avoiding the requirement for freestanding implementations to support <stdlib.h> and <stdio.h>. Below is a draft specification for a new header that provides the character sequence conversion functionality required by IEEE 754. Please look it over and send comments. I'd be particularly interested in hearing from Joel, who first asked for this facility.</div></div><div><br></div><div>-Jim</div><div><br></div><div>=======================</div><div><br></div><div>n Floating-point string conversions <floatstr.h><br> <br>The header <floatstr.h> defines one type and five functions for converting between floating types and decimal character sequences.<br> <br>The type declared is size_t (described in 7.19).<br> <br>n.1 The strfromd and strfromld functions<br> <br>Synopsis<br> <br>#include <floatstr.h><br>int strfromd(char * restrict s, size_t n, const char * restrict format, double x);<br>int strfromld(char * restrict s, size_t n, const char * restrict format, long double x);<br> <br>Descripton<br> <br>The strfromd and strfromld functions are defined by snprintf(s, n, format, x) (7.21.6.5).<br> <br>NOTE If the conversion specifier (in the string pointed to by format) for x is not for type double or long double, the behavior of strfromd or strfromld, respectively, is undefined.<br> <br>Returns<br> <br>The strfromd and strfromld functons return the values returned by snprintf(s, n, format, x) (7.21.6.5).<br> <br>n.2 The strtod, strtof, and strtold functions<br> <br>Synopsis<br> <br>#include <floatstr.h>
<br>double strtod(const char * restrict nptr, char ** restrict endptr);<br>float strtof(const char * restrict nptr, char ** restrict endptr);<br>long double strtold(const char * restrict nptr, char ** restrict endptr);<br>. <br>These functions are specified in 7.22.1.3.</div></body></html>