Skip to content

Commit 16b2239

Browse files
committed
add max effective written length
1 parent 3762d35 commit 16b2239

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

bench/xjb/float_to_string/ftoa.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Convert a float to string
1010
* @param v The float value to convert
1111
* @param buf The buffer to write the result to (must be at least 21 bytes)
12+
* Maximum effective written length for float is 15 bytes.
1213
* @return A pointer to the end of the written string (including the null terminator)
1314
*/
1415
char* xjb_ftoa(float v, char *buf);
@@ -17,6 +18,7 @@ char* xjb_ftoa(float v, char *buf);
1718
* Convert a double to string
1819
* @param v The double value to convert
1920
* @param buf The buffer to write the result to (must be at least 33 bytes)
21+
* Maximum effective written length for double is 24 bytes.
2022
* @return A pointer to the end of the written string (including the null terminator)
2123
*/
2224
char* xjb_ftoa(double v, char *buf);

src/ftoa.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Convert a float to string
2020
* @param v The float value to convert
2121
* @param buf The buffer to write the result to (must be at least 21 bytes)
22+
* Maximum effective written length for float is 15 bytes.
2223
* @return A pointer to the end of the written string (including the null terminator)
2324
*/
2425
char* xjb_ftoa(float v, char* buf);
@@ -27,6 +28,7 @@ char* xjb_ftoa(float v, char* buf);
2728
* Convert a double to string
2829
* @param v The double value to convert
2930
* @param buf The buffer to write the result to (must be at least 33 bytes)
31+
* Maximum effective written length for double is 24 bytes.
3032
* @return A pointer to the end of the written string (including the null terminator)
3133
*/
3234
char* xjb_ftoa(double v, char* buf);

0 commit comments

Comments
 (0)