Back to index

glibc  2.9
qefgcvt_r.c
Go to the documentation of this file.
00001 /* Compatibility functions for floating point formatting, reentrant,
00002    long double versions.
00003    Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
00004    This file is part of the GNU C Library.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #include <float.h>
00022 
00023 #define FLOAT_TYPE long double
00024 #define FUNC_PREFIX q
00025 #define FLOAT_FMT_FLAG "L"
00026 #define FLOAT_NAME_EXT l
00027 #define FLOAT_MIN_10_EXP LDBL_MIN_10_EXP
00028 #if LDBL_MANT_DIG == 64
00029 # define NDIGIT_MAX 21
00030 #elif LDBL_MANT_DIG == 53
00031 # define NDIGIT_MAX 17
00032 #elif LDBL_MANT_DIG == 113
00033 # define NDIGIT_MAX 36
00034 #elif LDBL_MANT_DIG == 106
00035 # define NDIGIT_MAX 34
00036 #elif LDBL_MANT_DIG == 56
00037 # define NDIGIT_MAX 18
00038 #else
00039 /* See IEEE 854 5.6, table 2 for this formula.  Unfortunately we need a
00040    compile time constant here, so we cannot use it.  */
00041 # error "NDIGIT_MAX must be precomputed"
00042 # define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * LDBL_MANT_DIG + 1.0)))
00043 #endif
00044 #if LDBL_MIN_10_EXP == -37
00045 # define FLOAT_MIN_10_NORM  1.0e-37L
00046 #elif LDBL_MIN_10_EXP == -291
00047 # define FLOAT_MIN_10_NORM  1.0e-291L
00048 #elif LDBL_MIN_10_EXP == -307
00049 # define FLOAT_MIN_10_NORM  1.0e-307L
00050 #elif LDBL_MIN_10_EXP == -4931
00051 # define FLOAT_MIN_10_NORM  1.0e-4931L
00052 #else
00053 /* libc can't depend on libm.  */
00054 # error "FLOAT_MIN_10_NORM must be precomputed"
00055 # define FLOAT_MIN_10_NORM  exp10l (LDBL_MIN_10_EXP)
00056 #endif
00057 
00058 #include "efgcvt_r.c"