1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Add strfromd, strfromf, and strfroml functions

ISO/IEC TS 18661-1 adds several functions in the strfrom family to stdlib.
This patch adds strfromd, strfromf, and strfroml.  This is being done in
preparation for the new floating-point type, float128.  The added functions
convert a floating-point value into a string, with configurable format.
This commit is contained in:
Gabriel F. T. Gomes
2016-06-28 17:30:42 -03:00
parent 78b7adbaea
commit 6962682ffe
42 changed files with 434 additions and 1 deletions

View File

@ -21,7 +21,8 @@
#ifndef _STDLIB_H
#include <features.h>
#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
#include <bits/libc-header-start.h>
/* Get size_t, wchar_t and NULL from <stddef.h>. */
#define __need_size_t
@ -178,6 +179,21 @@ extern unsigned long long int strtoull (const char *__restrict __nptr,
__END_NAMESPACE_C99
#endif /* ISO C99 or use MISC. */
/* Convert a floating-point number to a string. */
#if __GLIBC_USE (IEC_60559_BFP_EXT)
extern int strfromd (char *__dest, size_t __size, const char *__format,
double __f)
__THROW __nonnull ((3));
extern int strfromf (char *__dest, size_t __size, const char *__format,
float __f)
__THROW __nonnull ((3));
extern int strfroml (char *__dest, size_t __size, const char *__format,
long double __f)
__THROW __nonnull ((3));
#endif
#ifdef __USE_GNU
/* The concept of one static locale per category is not very well