Merge commit 'b572c3a256e7bf1e4eecc8c36448c08093240a6a' into stable
[gnulib.git] / lib / ftoastr.h
index 4c4f890..6264952 100644 (file)
@@ -1,6 +1,6 @@
 /* floating point to accurate string
 
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010-2011 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -26,8 +26,8 @@
 /* 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
@@ -39,8 +39,8 @@
 
    Example:
 
-     char buf[DBL_ABUFSIZE_BOUND];
-     int r = dtoastr (buf, sizeof buf, "%*.*g", 0, 0.1);
+     char buf[DBL_BUFSIZE_BOUND];
+     int r = dtoastr (buf, sizeof buf, 0, 0, 0.1);
 
    In the C locale, this sets R to 3 and stores "0.1" into BUF.  */