27 # define FLT_MANT_BIT FLT_MANT_DIG
28 # define DBL_MANT_BIT DBL_MANT_DIG
29 # define LDBL_MANT_BIT LDBL_MANT_DIG
31 # define FLT_MANT_BIT (FLT_MANT_DIG * 2)
32 # define DBL_MANT_BIT (DBL_MANT_DIG * 2)
33 # define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
35 # define FLT_MANT_BIT (FLT_MANT_DIG * 4)
36 # define DBL_MANT_BIT (DBL_MANT_DIG * 4)
37 # define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
41 #define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
42 #define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
43 #define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
48 (FLT_EXP_MASK < 0x100 ? 8 : \
49 FLT_EXP_MASK < 0x200 ? 9 : \
50 FLT_EXP_MASK < 0x400 ? 10 : \
51 FLT_EXP_MASK < 0x800 ? 11 : \
52 FLT_EXP_MASK < 0x1000 ? 12 : \
53 FLT_EXP_MASK < 0x2000 ? 13 : \
54 FLT_EXP_MASK < 0x4000 ? 14 : \
55 FLT_EXP_MASK < 0x8000 ? 15 : \
56 FLT_EXP_MASK < 0x10000 ? 16 : \
57 FLT_EXP_MASK < 0x20000 ? 17 : \
58 FLT_EXP_MASK < 0x40000 ? 18 : \
59 FLT_EXP_MASK < 0x80000 ? 19 : \
60 FLT_EXP_MASK < 0x100000 ? 20 : \
61 FLT_EXP_MASK < 0x200000 ? 21 : \
62 FLT_EXP_MASK < 0x400000 ? 22 : \
63 FLT_EXP_MASK < 0x800000 ? 23 : \
64 FLT_EXP_MASK < 0x1000000 ? 24 : \
65 FLT_EXP_MASK < 0x2000000 ? 25 : \
66 FLT_EXP_MASK < 0x4000000 ? 26 : \
67 FLT_EXP_MASK < 0x8000000 ? 27 : \
68 FLT_EXP_MASK < 0x10000000 ? 28 : \
69 FLT_EXP_MASK < 0x20000000 ? 29 : \
70 FLT_EXP_MASK < 0x40000000 ? 30 : \
71 FLT_EXP_MASK <= 0x7fffffff ? 31 : \
74 (DBL_EXP_MASK < 0x100 ? 8 : \
75 DBL_EXP_MASK < 0x200 ? 9 : \
76 DBL_EXP_MASK < 0x400 ? 10 : \
77 DBL_EXP_MASK < 0x800 ? 11 : \
78 DBL_EXP_MASK < 0x1000 ? 12 : \
79 DBL_EXP_MASK < 0x2000 ? 13 : \
80 DBL_EXP_MASK < 0x4000 ? 14 : \
81 DBL_EXP_MASK < 0x8000 ? 15 : \
82 DBL_EXP_MASK < 0x10000 ? 16 : \
83 DBL_EXP_MASK < 0x20000 ? 17 : \
84 DBL_EXP_MASK < 0x40000 ? 18 : \
85 DBL_EXP_MASK < 0x80000 ? 19 : \
86 DBL_EXP_MASK < 0x100000 ? 20 : \
87 DBL_EXP_MASK < 0x200000 ? 21 : \
88 DBL_EXP_MASK < 0x400000 ? 22 : \
89 DBL_EXP_MASK < 0x800000 ? 23 : \
90 DBL_EXP_MASK < 0x1000000 ? 24 : \
91 DBL_EXP_MASK < 0x2000000 ? 25 : \
92 DBL_EXP_MASK < 0x4000000 ? 26 : \
93 DBL_EXP_MASK < 0x8000000 ? 27 : \
94 DBL_EXP_MASK < 0x10000000 ? 28 : \
95 DBL_EXP_MASK < 0x20000000 ? 29 : \
96 DBL_EXP_MASK < 0x40000000 ? 30 : \
97 DBL_EXP_MASK <= 0x7fffffff ? 31 : \
99 #define LDBL_EXP_BIT \
100 (LDBL_EXP_MASK < 0x100 ? 8 : \
101 LDBL_EXP_MASK < 0x200 ? 9 : \
102 LDBL_EXP_MASK < 0x400 ? 10 : \
103 LDBL_EXP_MASK < 0x800 ? 11 : \
104 LDBL_EXP_MASK < 0x1000 ? 12 : \
105 LDBL_EXP_MASK < 0x2000 ? 13 : \
106 LDBL_EXP_MASK < 0x4000 ? 14 : \
107 LDBL_EXP_MASK < 0x8000 ? 15 : \
108 LDBL_EXP_MASK < 0x10000 ? 16 : \
109 LDBL_EXP_MASK < 0x20000 ? 17 : \
110 LDBL_EXP_MASK < 0x40000 ? 18 : \
111 LDBL_EXP_MASK < 0x80000 ? 19 : \
112 LDBL_EXP_MASK < 0x100000 ? 20 : \
113 LDBL_EXP_MASK < 0x200000 ? 21 : \
114 LDBL_EXP_MASK < 0x400000 ? 22 : \
115 LDBL_EXP_MASK < 0x800000 ? 23 : \
116 LDBL_EXP_MASK < 0x1000000 ? 24 : \
117 LDBL_EXP_MASK < 0x2000000 ? 25 : \
118 LDBL_EXP_MASK < 0x4000000 ? 26 : \
119 LDBL_EXP_MASK < 0x8000000 ? 27 : \
120 LDBL_EXP_MASK < 0x10000000 ? 28 : \
121 LDBL_EXP_MASK < 0x20000000 ? 29 : \
122 LDBL_EXP_MASK < 0x40000000 ? 30 : \
123 LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
129 #define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
130 #define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
131 #define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
138 #define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
139 #define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
140 #define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
int verify_sizeof_dbl[SIZEOF_DBL<=sizeof(double) ? 1 :- 1]
int verify_sizeof_ldbl[SIZEOF_LDBL<=sizeof(long double) ? 1 :- 1]
#define SIZEOF_FLT
Number of bytes used for a floating-point number.
int verify_sizeof_flt[SIZEOF_FLT<=sizeof(float) ? 1 :-1]
Verify that SIZEOF_FLT <= sizeof (float) etc.