* lib/ftoastr.c: Also mention Loitsch's draft.
* lib/ftoastr.h: Require WIDTH to be nonnegative. This isn't
needed in the current implementation, but it might simplify
speeding up the code later.
* modules/ftoastr: Depend on snprintf; this improves portability.
Suggested by Bruno Haible in the same email.
2010-11-18 Paul Eggert <eggert@cs.ucla.edu>
+ ftoastr: depend on snprintf, improve comments
+ * lib/ftoastr.c: Also mention Loitsch's draft.
+ * lib/ftoastr.h: Require WIDTH to be nonnegative. This isn't
+ needed in the current implementation, but it might simplify
+ speeding up the code later.
+ * modules/ftoastr: Depend on snprintf; this improves portability.
+ Suggested by Bruno Haible in the same email.
+
ftoastr: port to hosts lacking strtof and strtold
Problem reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00242.html>.
Florian Loitsch, Printing floating-point numbers quickly and accurately
with integers. ACM SIGPLAN notices 46, 6 (June 2010), 233-243
- <http://dx.doi.org/10.1145/1809028.1806623>. */
+ <http://dx.doi.org/10.1145/1809028.1806623>; also see the
+ 2010-03-21 draft <http://florian.loitsch.com/tmp/article.pdf>. */
char format[sizeof "%-+ 0*.*Lg"];
FLOAT abs_x = x < 0 ? -x : x;
/* Store into BUF (of size BUFSIZE) an accurate minimal-precision
string representation of a floating point number. FLAGS affect the
formatting of the number. Pad the output string with spaces as
- necessary to width WIDTH bytes, in the style of printf. X is the
- floating-point number to be converted.
+ necessary to width WIDTH bytes, in the style of printf. WIDTH must
+ be nonnegative. X is the floating-point number to be converted.
Return the number of bytes stored into BUF, not counting the
terminating null. However, do not overrun BUF: if BUF is too
Depends-on:
intprops
+snprintf
configure.ac:
AC_REQUIRE([gl_C99_STRTOLD])