-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreveal.c
187 lines (156 loc) · 12.2 KB
/
creveal.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// MIT License
//
// Copyright (c) 2019 Martin Werner Licht
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sej
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the fojowing conditions:
//
// The above copyright notice and this permission notice shaj be included in aj
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include <float.h>
#include <limits.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <wchar.h>
typedef intmax_t SInteger;
typedef uintmax_t UInteger;
int main()
{
printf(" \nsizes of classical signed integer types\n");
printf(" size of signed char : %ju\n", (UInteger)sizeof( signed char) );
printf(" size of signed short : %ju\n", (UInteger)sizeof( signed short) );
printf(" size of signed int : %ju\n", (UInteger)sizeof( signed int) );
printf(" size of signed long : %ju\n", (UInteger)sizeof( signed long) );
printf(" size of signed long long : %ju\n", (UInteger)sizeof( signed long long) );
printf(" \nsizes of classical unsigned integer types\n");
printf(" size of unsigned char : %ju\n", (UInteger)sizeof( unsigned char) );
printf(" size of unsigned short : %ju\n", (UInteger)sizeof( unsigned short) );
printf(" size of unsigned int : %ju\n", (UInteger)sizeof( unsigned int) );
printf(" size of unsigned long : %ju\n", (UInteger)sizeof( unsigned long) );
printf(" size of unsigned long long: %ju\n", (UInteger)sizeof(unsigned long long) );
printf(" \nMinima and Maxima of classical signed integer types\n");
printf(" SCHAR_MIN : %+jd\n", (SInteger)SCHAR_MIN );
printf(" SCHAR_MAX : %+jd\n", (SInteger)SCHAR_MAX );
printf(" SHRT_MIN : %+jd\n", (SInteger)SHRT_MIN );
printf(" SHRT_MAX : %+jd\n", (SInteger)SHRT_MAX );
printf(" INT_MIN : %+jd\n", (SInteger)INT_MIN );
printf(" INT_MAX : %+jd\n", (SInteger)INT_MAX );
printf(" LONG_MIN : %+jd\n", (SInteger)LONG_MIN );
printf(" LONG_MAX : %+jd\n", (SInteger)LONG_MAX );
printf(" LLONG_MIN : %+jd\n", (SInteger)LLONG_MIN );
printf(" LLONG_MAX : %+jd\n", (SInteger)LLONG_MAX );
printf(" \nMaxima of classical unsigned integer types\n");
printf(" USHRT_MAX : %ju\n", (UInteger)USHRT_MAX );
printf(" UINT_MAX : %ju\n", (UInteger)UINT_MAX );
printf(" ULONG_MAX : %ju\n", (UInteger)ULONG_MAX );
printf(" ULLONG_MAX : %ju\n", (UInteger)ULLONG_MAX );
printf(" \nsizes of floating-point types\n");
printf(" size of float : %ju\n", (UInteger)sizeof( float) );
printf(" size of double : %ju\n", (UInteger)sizeof( double) );
printf(" size of long double : %ju\n", (UInteger)sizeof(long double) );
#ifdef __STDC_IEC_559_COMPLEX__
printf(" \nsizes of complex floating-point types\n");
printf(" size of float _Complex : %ju\n", (UInteger)sizeof( float _Complex) );
printf(" size of double _Complex : %ju\n", (UInteger)sizeof( double _Complex) );
printf(" size of long double _Complex : %ju\n", (UInteger)sizeof(long double _Complex) );
#ifdef _Imaginary_I
printf(" \nsizes of imaginary floating-point types\n");
printf(" size of float _Imaginary : %ju\n", (UInteger)sizeof( float _Imaginary) );
printf(" size of double _Imaginary : %ju\n", (UInteger)sizeof( double _Imaginary) );
printf(" size of long double _Imaginary : %ju\n", (UInteger)sizeof(long double _Imaginary) );
#else
printf(" \nno support for imaginary floating-point types\n");
#endif
#else
printf(" \nno support for complex types\n");
#endif
printf(" \nFloating-point mode flags\n");
printf(" FLT_ROUNDS : %ld\n", (long) FLT_ROUNDS );
printf(" FLT_EVAL_METHOD : %ld\n", (long) FLT_EVAL_METHOD );
printf(" FLT_RADIX : %ld\n", (long) FLT_RADIX );
printf(" DECIMAL_DIG : %ld\n", (long) DECIMAL_DIG );
printf(" \nFloating-point properties\n");
printf(" FLT/DBL/LDBL_DECIMAL_DIG : %ld\t%ld\t%ld\n", (long) FLT_DECIMAL_DIG, (long) DBL_DECIMAL_DIG, (long) LDBL_DECIMAL_DIG );
printf(" FLT/DBL/LDBL_DIG : %ld\t%ld\t%ld\n", (long) FLT_DIG, (long) DBL_DIG, (long) LDBL_DIG );
printf(" FLT/DBL/LDBL_MANT_DIG : %ld\t%ld\t%ld\n", (long) FLT_MANT_DIG, (long) DBL_MANT_DIG, (long) LDBL_MANT_DIG );
printf(" FLT/DBL/LDBL_MIN_EXP : %ld\t%ld\t%ld\n", (long) FLT_MIN_EXP, (long) DBL_MIN_EXP, (long) LDBL_MIN_EXP );
printf(" FLT/DBL/LDBL_MAX_EXP : %ld\t%ld\t%ld\n", (long) FLT_MAX_EXP, (long) DBL_MAX_EXP, (long) LDBL_MAX_EXP );
printf(" FLT/DBL/LDBL_MIN_10_EXP : %ld\t%ld\t%ld\n", (long) FLT_MIN_10_EXP, (long) DBL_MIN_10_EXP, (long) LDBL_MIN_10_EXP );
printf(" FLT/DBL/LDBL_MAX_10_EXP : %ld\t%ld\t%ld\n", (long) FLT_MAX_10_EXP, (long) DBL_MAX_10_EXP, (long) LDBL_MAX_10_EXP );
printf(" FLT/DBL/LDBL_HAS_SUBNORM : %ld\t%ld\t%ld\n", (long) FLT_HAS_SUBNORM, (long) DBL_HAS_SUBNORM, (long) LDBL_HAS_SUBNORM );
printf(" \nFloating-point Minima and Maxima\n");
printf(" FLT/DBL/LDBL_TRUE_MIN : %Le\t%Le\t%Le\n", (long double) FLT_TRUE_MIN, (long double) DBL_TRUE_MIN, (long double) LDBL_TRUE_MIN );
printf(" FLT/DBL/LDBL_MIN : %Le\t%Le\t%Le\n", (long double) FLT_MIN, (long double) DBL_MIN, (long double) LDBL_MIN );
printf(" FLT/DBL/LDBL_MAX : %Le\t%Le\t%Le\n", (long double) FLT_MAX, (long double) DBL_MAX, (long double) LDBL_MAX );
printf(" FLT/DBL/LDBL_EPSILON : %Le\t%Le\t%Le\n", (long double) FLT_EPSILON, (long double) DBL_EPSILON, (long double) LDBL_EPSILON );
printf(" \nClassical and wide character-related sizes\n");
printf(" size of char : %ju\n", (UInteger)sizeof(char) );
printf(" size of wchar_t : %ju\n", (UInteger)sizeof(wchar_t) );
printf(" size of wint_t : %ju\n", (UInteger)sizeof(wint_t) );
printf(" \nClassical and wide character-related constants\n");
printf(" CHAR_MIN : %+jd\n", (SInteger)CHAR_MIN );
printf(" CHAR_MAX : %+jd\n", (SInteger)CHAR_MAX );
printf(" WCHAR_MIN : %+jd\n", (SInteger)WCHAR_MIN );
printf(" WCHAR_MAX : %+jd\n", (SInteger)WCHAR_MAX );
printf(" CHAR_BIT : %ju\n", (UInteger)CHAR_BIT );
printf(" MB_LEN_MAX : %ju\n", (UInteger)MB_LEN_MAX );
printf(" WINT_MIN: : %ju\n", (UInteger)WINT_MIN );
printf(" WINT_MAX : %ju\n", (UInteger)WINT_MAX );
printf(" \nsizes related to sizes and pointers\n");
printf(" size of void* : %ju\n", (UInteger)sizeof( void*) );
printf(" size of size_t : %ju\n", (UInteger)sizeof( size_t) );
printf(" size of ptrdiff_t : %ju\n", (UInteger)sizeof(ptrdiff_t) );
printf(" \nconstants related to sizes and pointers\n");
printf(" SIZE_MAX : %zd\n", SIZE_MAX );
printf(" PTRDIFF_MIN : %+td\n", PTRDIFF_MIN );
printf(" PTRDIFF_MAX : %+td\n", PTRDIFF_MAX );
printf(" \nsizes and constants of various (assorted) data types\n");
printf(" size of bool : %ju\n", (UInteger)sizeof(_Bool) );
printf(" true : %ju\n", (UInteger)true );
printf(" false : %ju\n", (UInteger)false );
printf(" \nsizes of C99 signed integer types\n");
printf(" size of int8/16/32/64_t : %ju\t%ju\t%ju\t%ju\n", (UInteger)sizeof(int8_t), (UInteger)sizeof(int16_t), (UInteger)sizeof(int32_t), (UInteger)sizeof(int64_t) );
printf(" size of int_least8/16/32/64_t : %ju\t%ju\t%ju\t%ju\n", (UInteger)sizeof(int_least8_t), (UInteger)sizeof(int_least16_t), (UInteger)sizeof(int_least32_t), (UInteger)sizeof(int_least64_t) );
printf(" size of int_fast8/16/32/64_t : %ju\t%ju\t%ju\t%ju\n", (UInteger)sizeof(int_fast8_t), (UInteger)sizeof(int_fast16_t), (UInteger)sizeof(int_fast32_t), (UInteger)sizeof(int_fast64_t) );
printf(" size of intmax_t : %ju\n", (UInteger)sizeof(intmax_t) );
printf(" size of intptr_t : %ju\n", (UInteger)sizeof(intptr_t) );
printf(" \nMinima and maxima of C99 signed integer types\n");
printf(" INT8/16/32/64_MIN: : %+jd\t%+jd\t%+jd\t%+jd\n", (SInteger)INT8_MIN, (SInteger)INT16_MIN, (SInteger)INT32_MIN, (SInteger)INT64_MIN );
printf(" INT8/16/32/64_MAX : %+jd\t%+jd\t%+jd\t%+jd\n", (SInteger)INT8_MAX, (SInteger)INT16_MAX, (SInteger)INT32_MAX, (SInteger)INT64_MAX );
printf(" INT_LEAST8/16/32/64_MIN : %+jd\t%+jd\t%+jd\t%+jd\n", (SInteger)INT_LEAST8_MIN, (SInteger)INT_LEAST16_MIN, (SInteger)INT_LEAST32_MIN, (SInteger)INT_LEAST64_MIN );
printf(" INT_LEAST8/16/32/64_MAX : %+jd\t%+jd\t%+jd\t%+jd\n", (SInteger)INT_LEAST8_MAX, (SInteger)INT_LEAST16_MAX, (SInteger)INT_LEAST32_MAX, (SInteger)INT_LEAST64_MAX );
printf(" INT_FAST8/16/32/64_MIN : %+jd\t%+jd\t%+jd\t%+jd\n", (SInteger)INT_FAST8_MIN, (SInteger)INT_FAST16_MIN, (SInteger)INT_FAST32_MIN, (SInteger)INT_FAST64_MIN );
printf(" INT_FAST8/16/32/64_MAX : %+jd\t%+jd\t%+jd\t%+jd\n", (SInteger)INT_FAST8_MAX, (SInteger)INT_FAST16_MAX, (SInteger)INT_FAST32_MAX, (SInteger)INT_FAST64_MAX );
printf(" INTMAX_MIN : %+jd\n", (SInteger)INTMAX_MIN );
printf(" INTMAX_MAX : %+jd\n", (SInteger)INTMAX_MAX );
printf(" INTPTR_MIN : %+jd\n", (SInteger)INTPTR_MIN );
printf(" INTPTR_MAX : %+jd\n", (SInteger)INTPTR_MAX );
printf(" \nsizes of C99 unsigned integer types\n");
printf(" size of uint8/16/32/64_t : %ju\t%ju\t%ju\t%ju\n", (UInteger)sizeof(uint8_t), (UInteger)sizeof(uint16_t), (UInteger)sizeof(uint32_t), (UInteger)sizeof(uint64_t) );
printf(" size of uint_least8/16/32/64_t : %ju\t%ju\t%ju\t%ju\n", (UInteger)sizeof(uint_least8_t), (UInteger)sizeof(uint_least16_t), (UInteger)sizeof(uint_least32_t), (UInteger)sizeof(uint_least64_t) );
printf(" size of uint_fast8/16/32/64_t : %ju\t%ju\t%ju\t%ju\n", (UInteger)sizeof(uint_fast8_t), (UInteger)sizeof(uint_fast16_t), (UInteger)sizeof(uint_fast32_t), (UInteger)sizeof(uint_fast64_t) );
printf(" size of uintmax_t : %ju\n", (UInteger)sizeof(uintmax_t) );
printf(" size of uintptr_t : %ju\n", (UInteger)sizeof(uintptr_t) );
printf(" \nMinima and maxima of C99 unsigned integer types\n");
printf(" UINT8/16/32/64_MAX : %ju\t%ju\t%ju\t%ju\n", (UInteger)UINT8_MAX, (UInteger)UINT16_MAX, (UInteger)UINT32_MAX, (UInteger)UINT64_MAX );
printf(" UINT_LEAST8/16/32/64_MAX : %ju\t%ju\t%ju\t%ju\n", (UInteger)UINT_LEAST8_MAX, (UInteger)UINT_LEAST16_MAX, (UInteger)UINT_LEAST32_MAX, (UInteger)UINT_LEAST64_MAX );
printf(" UINT_FAST8/16/32/64_MAX : %ju\t%ju\t%ju\t%ju\n", (UInteger)UINT_FAST8_MAX, (UInteger)UINT_FAST16_MAX, (UInteger)UINT_FAST32_MAX, (UInteger)UINT_FAST64_MAX );
printf(" UINTMAX_MAX : %ju\n", (UInteger)UINTMAX_MAX );
printf(" UINTPTR_MAX : %ju\n", (UInteger)UINTPTR_MAX );
//intptr_t INTPTR_MIN INTPTR_MAX uintptr_t 0 UINTPTR_MAX
return 0;
}