values.h
01:
02:
03:
04:
05:
06:
07:
08:
09:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23: #ifndef _VALUES_H
24: #define _VALUES_H 1
25:
26: #include <features.h>
27:
28: #include <limits.h>
29:
30: #define _TYPEBITS(type) (sizeof (type) * CHAR_BIT)
31:
32: #define CHARBITS _TYPEBITS (char)
33: #define SHORTBITS _TYPEBITS (short int)
34: #define INTBITS _TYPEBITS (int)
35: #define LONGBITS _TYPEBITS (long int)
36: #define PTRBITS _TYPEBITS (char *)
37: #define DOUBLEBITS _TYPEBITS (double)
38: #define FLOATBITS _TYPEBITS (float)
39:
40: #define MINSHORT SHRT_MIN
41: #define MININT INT_MIN
42: #define MINLONG LONG_MIN
43:
44: #define MAXSHORT SHRT_MAX
45: #define MAXINT INT_MAX
46: #define MAXLONG LONG_MAX
47:
48: #define HIBITS MINSHORT
49: #define HIBITL MINLONG
50:
51:
52: #include <float.h>
53:
54: #define MAXDOUBLE DBL_MAX
55: #define MAXFLOAT FLT_MAX
56: #define MINDOUBLE DBL_MIN
57: #define MINFLOAT FLT_MIN
58: #define DMINEXP DBL_MIN_EXP
59: #define FMINEXP FLT_MIN_EXP
60: #define DMAXEXP DBL_MAX_EXP
61: #define FMAXEXP FLT_MAX_EXP
62:
63:
64: #ifdef __USE_MISC
65:
66: # define BITSPERBYTE CHAR_BIT
67: #endif
68:
69: #endif
70:
© Andrew Scott 2006 -
2024,
All Rights Reserved