2 #warning "this file includes <values.h> which is obsoleted, use <limits.h> or <float.h> instead"
6 Copyright (C) 1988 Free Software Foundation
7 written by Doug Lea (dl@rocky.oswego.edu)
9 This file is part of the GNU C++ Library. This library is free
10 software; you can redistribute it and/or modify it under the terms of
11 the GNU Library General Public License as published by the Free
12 Software Foundation; either version 2 of the License, or (at your
13 option) any later version. This library is distributed in the hope
14 that it will be useful, but WITHOUT ANY WARRANTY; without even the
15 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 PURPOSE. See the GNU Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
27 #define BITS(type) (BITSPERBYTE * (int)sizeof(type))
29 #define CHARBITS BITS(char)
30 #define SHORTBITS BITS(short)
31 #define INTBITS BITS(int)
32 #define LONGBITS BITS(long)
33 #define PTRBITS BITS(char*)
34 #define DOUBLEBITS BITS(double)
35 #define FLOATBITS BITS(float)
37 #define MINSHORT ((short)(1 << (SHORTBITS - 1)))
38 #define MININT (1 << (INTBITS - 1))
39 #define MINLONG (1L << (LONGBITS - 1))
41 #define MAXSHORT ((short)~MINSHORT)
42 #define MAXINT (~MININT)
43 #define MAXLONG (~MINLONG)
45 #define HIBITS MINSHORT
46 #define HIBITL MINLONG
48 #if defined(sun) || defined(hp300) || defined(hpux) || defined(masscomp) || defined(sgi)
52 double maxdouble_val; \
54 __asm ("fmove%.d #0x7fefffffffffffff,%0" /* Max double */ \
55 : "=f" (maxdouble_val) \
59 #define MAXFLOAT ((float) 3.40e+38)
61 #define MAXDOUBLE 1.79769313486231470e+308
62 #define MAXFLOAT ((float)3.40282346638528860e+38)
64 #define MINDOUBLE 4.94065645841246544e-324
65 #define MINFLOAT ((float)1.40129846432481707e-45)
70 #define DMINEXP (-(DMAXEXP + DSIGNIF - _HIDDENBIT - 3))
71 #define FMINEXP (-(FMAXEXP + FSIGNIF - _HIDDENBIT - 3))
72 #define DMAXEXP ((1 << _DEXPLEN - 1) - 1 + _IEEE)
73 #define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE)
76 #define MAXDOUBLE 1.79769313486231470e+308
77 #define MAXFLOAT ((float)3.40282346638528860e+38)
78 #define MINDOUBLE 2.2250738585072010e-308
79 #define MINFLOAT ((float)1.17549435e-38)
84 #define DMINEXP (-(DMAXEXP + DSIGNIF - _HIDDENBIT - 3))
85 #define FMINEXP (-(FMAXEXP + FSIGNIF - _HIDDENBIT - 3))
86 #define DMAXEXP ((1 << _DEXPLEN - 1) - 1 + _IEEE)
87 #define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE)
89 #elif defined(sequent)
90 extern double _maxdouble, _mindouble;
91 extern float _maxfloat, _minfloat;
92 #define MAXDOUBLE _maxdouble
93 #define MAXFLOAT _maxfloat
94 #define MINDOUBLE _mindouble
95 #define MINFLOAT _minfloat
100 #define DMINEXP (-(DMAXEXP - 3))
101 #define FMINEXP (-(FMAXEXP - 3))
102 #define DMAXEXP ((1 << _DEXPLEN - 1) - 1 + _IEEE)
103 #define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE)
106 #define MAXDOUBLE 1.79769313486231570e+308
107 #define MAXFLOAT ((float)3.40282346638528860e+38)
108 #define MINDOUBLE 2.22507385850720140e-308
109 #define MINFLOAT ((float)1.17549435082228750e-38)
114 #define DMINEXP (-DMAXEXP)
115 #define FMINEXP (-FMAXEXP)
116 #define DMAXEXP ((1 << _DEXPLEN - 1) - 1 + _IEEE)
117 #define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE)
119 /* from Andrew Klossner <andrew%frip.wv.tek.com@relay.cs.net> */
121 /* These are "good" guesses ...
122 I'll figure out the true mins and maxes later, at the time I find
123 out the mins and maxes that the compiler can tokenize. */
124 #define MAXDOUBLE 1.79769313486231e+308
125 #define MAXFLOAT ((float)3.40282346638528e+38)
126 #define MINDOUBLE 2.22507385850720e-308
127 #define MINFLOAT ((float)1.17549435082228e-38)
132 #define DMINEXP (1-DMAXEXP)
133 #define FMINEXP (1-FMAXEXP)
134 #define DMAXEXP ((1 << _DEXPLEN - 1) - 1 + _IEEE)
135 #define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE)
137 #elif defined(convex)
138 #define MAXDOUBLE 8.9884656743115785e+306
139 #define MAXFLOAT ((float) 1.70141173e+38)
140 #define MINDOUBLE 5.5626846462680035e-308
141 #define MINFLOAT ((float) 2.93873588e-39)
146 #define DMINEXP (-DMAXEXP)
147 #define FMINEXP (-FMAXEXP)
148 #define DMAXEXP ((1 << _DEXPLEN - 1) - 1 + _IEEE)
149 #define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE)
151 /* #elif defined(vax) */
152 /* use vax versions by default -- they seem to be the most conservative */
155 #define MAXDOUBLE 1.701411834604692293e+38
156 #define MINDOUBLE (2.938735877055718770e-39)
158 #define MAXFLOAT 1.7014117331926443e+38
159 #define MINFLOAT 2.9387358770557188e-39
165 #define DMINEXP (-DMAXEXP)
166 #define FMINEXP (-FMAXEXP)
167 #define DMAXEXP ((1 << _DEXPLEN - 1) - 1 + _IEEE)
168 #define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE)
171 #define DSIGNIF (DOUBLEBITS - _DEXPLEN + _HIDDENBIT - 1)
172 #define FSIGNIF (FLOATBITS - _FEXPLEN + _HIDDENBIT - 1)
173 #define DMAXPOWTWO ((double)(1L << LONGBITS -2)*(1L << DSIGNIF - LONGBITS +1))
174 #define FMAXPOWTWO ((float)(1L << FSIGNIF - 1))
176 #endif /* !_VALUES_H_ */