added some code to format floating-point numbers

This commit is contained in:
2013-10-15 16:35:23 +00:00
parent 99ac89fc57
commit b70e378041
6 changed files with 339 additions and 426 deletions

View File

@ -291,6 +291,14 @@ QSE_EXPORT int qse_fmtuintmaxtowcs (
# define qse_fmtuintmax(b,sz,v,bf,pr,fc,pf) qse_fmtuintmaxtowcs(b,sz,v,bf,pr,fc,pf)
#endif
QSE_EXPORT int qse_fmtfltmaxtombs (
qse_mchar_t* buf,
qse_size_t bufsize,
qse_fltmax_t f,
qse_mchar_t point,
int digits
);
#ifdef __cplusplus
}
#endif

View File

@ -454,7 +454,7 @@ typedef qse_int_t qse_intptr_t;
/** @typedef qse_flt_t
* The qse_flt_t type defines the largest floating-pointer number type
* supported.
* naturally supported.
*/
#if defined(__FreeBSD__)
/* TODO: check if the support for long double is complete.
@ -469,16 +469,17 @@ typedef qse_int_t qse_intptr_t;
# define QSE_SIZEOF_FLT_T QSE_SIZEOF_DOUBLE
#endif
/* TODO: qse_fltmax_t to include the quadruple precision floating-point type.
*
#if QSE_SIZEOF___FLOAT128 > 0
/** @typedef qse_fltmax_t
* The qse_fltmax_t type defines the largest floating-pointer number type
* ever supported.
*/
#if QSE_SIZEOF__FLOAT128 > QSE_SIZEOF_FLT_T
typedef __float128 qse_fltmax_t;
# define QSE_SIZEOF_FLTMAX_T QSE_SIZEOF___FLOAT128
#else
typedef qse_flt_t qse_fltmax_t;
# define QSE_SIZEOF_FLTMAX_T QSE_SIZEOF_FLT_T
#endif
*/
/**
* The qse_mchar_t type defines a multi-byte character type.