]> git.ipfire.org Git - thirdparty/glibc.git/blame - stdlib/fpioconst.h
* elf/dl-load.c (_dl_map_object_from_fd): Bail if no PT_LOAD phdrs
[thirdparty/glibc.git] / stdlib / fpioconst.h
CommitLineData
28f540f4 1/* Header file for constants used in floating point <-> decimal conversions.
418f1701 2 Copyright (C) 1995,1996,1997,1998,1999,2002 Free Software Foundation, Inc.
7cc27f44 3 This file is part of the GNU C Library.
28f540f4 4
7cc27f44 5 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
28f540f4 9
7cc27f44
UD
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 13 Lesser General Public License for more details.
28f540f4 14
41bdb6e2
AJ
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
28f540f4
RM
19
20#ifndef _FPIOCONST_H
21#define _FPIOCONST_H
22
23#include <float.h>
76235ed4 24#include <math.h>
28f540f4
RM
25#include "gmp.h"
26
27
28/* These values are used by __printf_fp, where they are noncritical (if the
29 value is not large enough, it will just be slower); and by
30 strtof/strtod/strtold, where it is critical (it's used for overflow
31 detection).
32
33 XXX These should be defined in <float.h>. For the time being, we have the
34 IEEE754 values here. */
35
390955cb
UD
36#ifndef __NO_LONG_DOUBLE_MATH
37# define LDBL_MAX_10_EXP_LOG 12 /* = floor(log_2(LDBL_MAX_10_EXP)) */
38#else
39# define LDBL_MAX_10_EXP_LOG 8 /* = floor(log_2(LDBL_MAX_10_EXP)) */
40#endif
28f540f4
RM
41#define DBL_MAX_10_EXP_LOG 8 /* = floor(log_2(DBL_MAX_10_EXP)) */
42#define FLT_MAX_10_EXP_LOG 5 /* = floor(log_2(FLT_MAX_10_EXP)) */
43
44
c4563d2d 45/* The array with the number representation. */
418f1701 46extern const mp_limb_t __tens[] attribute_hidden;
c4563d2d 47
28f540f4
RM
48/* Table of powers of ten. This is used by __printf_fp and by
49 strtof/strtod/strtold. */
50struct mp_power
51 {
c4563d2d 52 size_t arrayoff; /* Offset in `__tens'. */
28f540f4
RM
53 mp_size_t arraysize; /* Size of the array. */
54 int p_expo; /* Exponent of the number 10^(2^i). */
55 int m_expo; /* Exponent of the number 10^-(2^i-1). */
56 };
418f1701
UD
57extern const struct mp_power _fpioconst_pow10[LDBL_MAX_10_EXP_LOG + 1]
58 attribute_hidden;
28f540f4 59
bfc04a9f
RM
60/* The constants in the array `_fpioconst_pow10' have an offset. */
61#if BITS_PER_MP_LIMB == 32
62# define _FPIO_CONST_OFFSET 2
63#else
64# define _FPIO_CONST_OFFSET 1
65#endif
66
28f540f4
RM
67
68#endif /* fpioconst.h */