Remove building with NOCRYPTO option
[minix.git] / external / bsd / libc++ / dist / libcxx / test / numerics / c.math / cmath.pass.cpp
blob973bea0151548f7ddbd6fba45c35500c4e3dc084
1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
10 // <cmath>
12 // NOTE: isinf and isnan are tested separately because they are expected to fail
13 // on linux. We don't want their expected failure to hide other failures in this file.
15 #include <cmath>
16 #include <type_traits>
17 #include <cassert>
19 #include "hexfloat.h"
21 // convertible to int/float/double/etc
22 template <class T, int N=0>
23 struct Value {
24 operator T () { return T(N); }
27 void test_abs()
29 static_assert((std::is_same<decltype(std::abs((float)0)), float>::value), "");
30 static_assert((std::is_same<decltype(std::abs((double)0)), double>::value), "");
31 static_assert((std::is_same<decltype(std::abs((long double)0)), long double>::value), "");
32 assert(std::abs(-1.) == 1);
35 void test_acos()
37 static_assert((std::is_same<decltype(std::acos((float)0)), float>::value), "");
38 static_assert((std::is_same<decltype(std::acos((bool)0)), double>::value), "");
39 static_assert((std::is_same<decltype(std::acos((unsigned short)0)), double>::value), "");
40 static_assert((std::is_same<decltype(std::acos((int)0)), double>::value), "");
41 static_assert((std::is_same<decltype(std::acos((unsigned int)0)), double>::value), "");
42 static_assert((std::is_same<decltype(std::acos((long)0)), double>::value), "");
43 static_assert((std::is_same<decltype(std::acos((unsigned long)0)), double>::value), "");
44 static_assert((std::is_same<decltype(std::acos((long long)0)), double>::value), "");
45 static_assert((std::is_same<decltype(std::acos((unsigned long long)0)), double>::value), "");
46 static_assert((std::is_same<decltype(std::acos((double)0)), double>::value), "");
47 static_assert((std::is_same<decltype(std::acos((long double)0)), long double>::value), "");
48 static_assert((std::is_same<decltype(std::acosf(0)), float>::value), "");
49 static_assert((std::is_same<decltype(std::acosl(0)), long double>::value), "");
50 assert(std::acos(1) == 0);
53 void test_asin()
55 static_assert((std::is_same<decltype(std::asin((float)0)), float>::value), "");
56 static_assert((std::is_same<decltype(std::asin((bool)0)), double>::value), "");
57 static_assert((std::is_same<decltype(std::asin((unsigned short)0)), double>::value), "");
58 static_assert((std::is_same<decltype(std::asin((int)0)), double>::value), "");
59 static_assert((std::is_same<decltype(std::asin((unsigned int)0)), double>::value), "");
60 static_assert((std::is_same<decltype(std::asin((long)0)), double>::value), "");
61 static_assert((std::is_same<decltype(std::asin((unsigned long)0)), double>::value), "");
62 static_assert((std::is_same<decltype(std::asin((long long)0)), double>::value), "");
63 static_assert((std::is_same<decltype(std::asin((unsigned long long)0)), double>::value), "");
64 static_assert((std::is_same<decltype(std::asin((double)0)), double>::value), "");
65 static_assert((std::is_same<decltype(std::asin((long double)0)), long double>::value), "");
66 static_assert((std::is_same<decltype(std::asinf(0)), float>::value), "");
67 static_assert((std::is_same<decltype(std::asinl(0)), long double>::value), "");
68 assert(std::asin(0) == 0);
71 void test_atan()
73 static_assert((std::is_same<decltype(std::atan((float)0)), float>::value), "");
74 static_assert((std::is_same<decltype(std::atan((bool)0)), double>::value), "");
75 static_assert((std::is_same<decltype(std::atan((unsigned short)0)), double>::value), "");
76 static_assert((std::is_same<decltype(std::atan((int)0)), double>::value), "");
77 static_assert((std::is_same<decltype(std::atan((unsigned int)0)), double>::value), "");
78 static_assert((std::is_same<decltype(std::atan((long)0)), double>::value), "");
79 static_assert((std::is_same<decltype(std::atan((unsigned long)0)), double>::value), "");
80 static_assert((std::is_same<decltype(std::atan((long long)0)), double>::value), "");
81 static_assert((std::is_same<decltype(std::atan((unsigned long long)0)), double>::value), "");
82 static_assert((std::is_same<decltype(std::atan((double)0)), double>::value), "");
83 static_assert((std::is_same<decltype(std::atan((long double)0)), long double>::value), "");
84 static_assert((std::is_same<decltype(std::atanf(0)), float>::value), "");
85 static_assert((std::is_same<decltype(std::atanl(0)), long double>::value), "");
86 assert(std::atan(0) == 0);
89 void test_atan2()
91 static_assert((std::is_same<decltype(std::atan2((float)0, (float)0)), float>::value), "");
92 static_assert((std::is_same<decltype(std::atan2((bool)0, (float)0)), double>::value), "");
93 static_assert((std::is_same<decltype(std::atan2((unsigned short)0, (double)0)), double>::value), "");
94 static_assert((std::is_same<decltype(std::atan2((int)0, (long double)0)), long double>::value), "");
95 static_assert((std::is_same<decltype(std::atan2((float)0, (unsigned int)0)), double>::value), "");
96 static_assert((std::is_same<decltype(std::atan2((double)0, (long)0)), double>::value), "");
97 static_assert((std::is_same<decltype(std::atan2((long double)0, (unsigned long)0)), long double>::value), "");
98 static_assert((std::is_same<decltype(std::atan2((int)0, (long long)0)), double>::value), "");
99 static_assert((std::is_same<decltype(std::atan2((int)0, (unsigned long long)0)), double>::value), "");
100 static_assert((std::is_same<decltype(std::atan2((double)0, (double)0)), double>::value), "");
101 static_assert((std::is_same<decltype(std::atan2((long double)0, (long double)0)), long double>::value), "");
102 static_assert((std::is_same<decltype(std::atan2((float)0, (double)0)), double>::value), "");
103 static_assert((std::is_same<decltype(std::atan2((float)0, (long double)0)), long double>::value), "");
104 static_assert((std::is_same<decltype(std::atan2((double)0, (long double)0)), long double>::value), "");
105 static_assert((std::is_same<decltype(std::atan2f(0,0)), float>::value), "");
106 static_assert((std::is_same<decltype(std::atan2l(0,0)), long double>::value), "");
107 static_assert((std::is_same<decltype(std::atan2((int)0, (int)0)), double>::value), "");
108 assert(std::atan2(0,1) == 0);
111 void test_ceil()
113 static_assert((std::is_same<decltype(std::ceil((float)0)), float>::value), "");
114 static_assert((std::is_same<decltype(std::ceil((bool)0)), double>::value), "");
115 static_assert((std::is_same<decltype(std::ceil((unsigned short)0)), double>::value), "");
116 static_assert((std::is_same<decltype(std::ceil((int)0)), double>::value), "");
117 static_assert((std::is_same<decltype(std::ceil((unsigned int)0)), double>::value), "");
118 static_assert((std::is_same<decltype(std::ceil((long)0)), double>::value), "");
119 static_assert((std::is_same<decltype(std::ceil((unsigned long)0)), double>::value), "");
120 static_assert((std::is_same<decltype(std::ceil((long long)0)), double>::value), "");
121 static_assert((std::is_same<decltype(std::ceil((unsigned long long)0)), double>::value), "");
122 static_assert((std::is_same<decltype(std::ceil((double)0)), double>::value), "");
123 static_assert((std::is_same<decltype(std::ceil((long double)0)), long double>::value), "");
124 static_assert((std::is_same<decltype(std::ceilf(0)), float>::value), "");
125 static_assert((std::is_same<decltype(std::ceill(0)), long double>::value), "");
126 assert(std::ceil(0) == 0);
129 void test_cos()
131 static_assert((std::is_same<decltype(std::cos((float)0)), float>::value), "");
132 static_assert((std::is_same<decltype(std::cos((bool)0)), double>::value), "");
133 static_assert((std::is_same<decltype(std::cos((unsigned short)0)), double>::value), "");
134 static_assert((std::is_same<decltype(std::cos((int)0)), double>::value), "");
135 static_assert((std::is_same<decltype(std::cos((unsigned int)0)), double>::value), "");
136 static_assert((std::is_same<decltype(std::cos((long)0)), double>::value), "");
137 static_assert((std::is_same<decltype(std::cos((unsigned long)0)), double>::value), "");
138 static_assert((std::is_same<decltype(std::cos((long long)0)), double>::value), "");
139 static_assert((std::is_same<decltype(std::cos((unsigned long long)0)), double>::value), "");
140 static_assert((std::is_same<decltype(std::cos((double)0)), double>::value), "");
141 static_assert((std::is_same<decltype(std::cos((long double)0)), long double>::value), "");
142 static_assert((std::is_same<decltype(std::cosf(0)), float>::value), "");
143 static_assert((std::is_same<decltype(std::cosl(0)), long double>::value), "");
144 assert(std::cos(0) == 1);
147 void test_cosh()
149 static_assert((std::is_same<decltype(std::cosh((float)0)), float>::value), "");
150 static_assert((std::is_same<decltype(std::cosh((bool)0)), double>::value), "");
151 static_assert((std::is_same<decltype(std::cosh((unsigned short)0)), double>::value), "");
152 static_assert((std::is_same<decltype(std::cosh((int)0)), double>::value), "");
153 static_assert((std::is_same<decltype(std::cosh((unsigned int)0)), double>::value), "");
154 static_assert((std::is_same<decltype(std::cosh((long)0)), double>::value), "");
155 static_assert((std::is_same<decltype(std::cosh((unsigned long)0)), double>::value), "");
156 static_assert((std::is_same<decltype(std::cosh((long long)0)), double>::value), "");
157 static_assert((std::is_same<decltype(std::cosh((unsigned long long)0)), double>::value), "");
158 static_assert((std::is_same<decltype(std::cosh((double)0)), double>::value), "");
159 static_assert((std::is_same<decltype(std::cosh((long double)0)), long double>::value), "");
160 static_assert((std::is_same<decltype(std::coshf(0)), float>::value), "");
161 static_assert((std::is_same<decltype(std::coshl(0)), long double>::value), "");
162 assert(std::cosh(0) == 1);
165 void test_exp()
167 static_assert((std::is_same<decltype(std::exp((float)0)), float>::value), "");
168 static_assert((std::is_same<decltype(std::exp((bool)0)), double>::value), "");
169 static_assert((std::is_same<decltype(std::exp((unsigned short)0)), double>::value), "");
170 static_assert((std::is_same<decltype(std::exp((int)0)), double>::value), "");
171 static_assert((std::is_same<decltype(std::exp((unsigned int)0)), double>::value), "");
172 static_assert((std::is_same<decltype(std::exp((long)0)), double>::value), "");
173 static_assert((std::is_same<decltype(std::exp((unsigned long)0)), double>::value), "");
174 static_assert((std::is_same<decltype(std::exp((long long)0)), double>::value), "");
175 static_assert((std::is_same<decltype(std::exp((unsigned long long)0)), double>::value), "");
176 static_assert((std::is_same<decltype(std::exp((double)0)), double>::value), "");
177 static_assert((std::is_same<decltype(std::exp((long double)0)), long double>::value), "");
178 static_assert((std::is_same<decltype(std::expf(0)), float>::value), "");
179 static_assert((std::is_same<decltype(std::expl(0)), long double>::value), "");
180 assert(std::exp(0) == 1);
183 void test_fabs()
185 static_assert((std::is_same<decltype(std::fabs((float)0)), float>::value), "");
186 static_assert((std::is_same<decltype(std::fabs((bool)0)), double>::value), "");
187 static_assert((std::is_same<decltype(std::fabs((unsigned short)0)), double>::value), "");
188 static_assert((std::is_same<decltype(std::fabs((int)0)), double>::value), "");
189 static_assert((std::is_same<decltype(std::fabs((unsigned int)0)), double>::value), "");
190 static_assert((std::is_same<decltype(std::fabs((long)0)), double>::value), "");
191 static_assert((std::is_same<decltype(std::fabs((unsigned long)0)), double>::value), "");
192 static_assert((std::is_same<decltype(std::fabs((long long)0)), double>::value), "");
193 static_assert((std::is_same<decltype(std::fabs((unsigned long long)0)), double>::value), "");
194 static_assert((std::is_same<decltype(std::fabs((double)0)), double>::value), "");
195 static_assert((std::is_same<decltype(std::fabs((long double)0)), long double>::value), "");
196 static_assert((std::is_same<decltype(std::fabsf(0.0f)), float>::value), "");
197 static_assert((std::is_same<decltype(std::fabsl(0.0L)), long double>::value), "");
198 assert(std::fabs(-1) == 1);
201 void test_floor()
203 static_assert((std::is_same<decltype(std::floor((float)0)), float>::value), "");
204 static_assert((std::is_same<decltype(std::floor((bool)0)), double>::value), "");
205 static_assert((std::is_same<decltype(std::floor((unsigned short)0)), double>::value), "");
206 static_assert((std::is_same<decltype(std::floor((int)0)), double>::value), "");
207 static_assert((std::is_same<decltype(std::floor((unsigned int)0)), double>::value), "");
208 static_assert((std::is_same<decltype(std::floor((long)0)), double>::value), "");
209 static_assert((std::is_same<decltype(std::floor((unsigned long)0)), double>::value), "");
210 static_assert((std::is_same<decltype(std::floor((long long)0)), double>::value), "");
211 static_assert((std::is_same<decltype(std::floor((unsigned long long)0)), double>::value), "");
212 static_assert((std::is_same<decltype(std::floor((double)0)), double>::value), "");
213 static_assert((std::is_same<decltype(std::floor((long double)0)), long double>::value), "");
214 static_assert((std::is_same<decltype(std::floorf(0)), float>::value), "");
215 static_assert((std::is_same<decltype(std::floorl(0)), long double>::value), "");
216 assert(std::floor(1) == 1);
219 void test_fmod()
221 static_assert((std::is_same<decltype(std::fmod((float)0, (float)0)), float>::value), "");
222 static_assert((std::is_same<decltype(std::fmod((bool)0, (float)0)), double>::value), "");
223 static_assert((std::is_same<decltype(std::fmod((unsigned short)0, (double)0)), double>::value), "");
224 static_assert((std::is_same<decltype(std::fmod((int)0, (long double)0)), long double>::value), "");
225 static_assert((std::is_same<decltype(std::fmod((float)0, (unsigned int)0)), double>::value), "");
226 static_assert((std::is_same<decltype(std::fmod((double)0, (long)0)), double>::value), "");
227 static_assert((std::is_same<decltype(std::fmod((long double)0, (unsigned long)0)), long double>::value), "");
228 static_assert((std::is_same<decltype(std::fmod((int)0, (long long)0)), double>::value), "");
229 static_assert((std::is_same<decltype(std::fmod((int)0, (unsigned long long)0)), double>::value), "");
230 static_assert((std::is_same<decltype(std::fmod((double)0, (double)0)), double>::value), "");
231 static_assert((std::is_same<decltype(std::fmod((long double)0, (long double)0)), long double>::value), "");
232 static_assert((std::is_same<decltype(std::fmod((float)0, (double)0)), double>::value), "");
233 static_assert((std::is_same<decltype(std::fmod((float)0, (long double)0)), long double>::value), "");
234 static_assert((std::is_same<decltype(std::fmod((double)0, (long double)0)), long double>::value), "");
235 static_assert((std::is_same<decltype(std::fmodf(0,0)), float>::value), "");
236 static_assert((std::is_same<decltype(std::fmodl(0,0)), long double>::value), "");
237 static_assert((std::is_same<decltype(std::fmod((int)0, (int)0)), double>::value), "");
238 assert(std::fmod(1.5,1) == .5);
241 void test_frexp()
243 int ip;
244 static_assert((std::is_same<decltype(std::frexp((float)0, &ip)), float>::value), "");
245 static_assert((std::is_same<decltype(std::frexp((bool)0, &ip)), double>::value), "");
246 static_assert((std::is_same<decltype(std::frexp((unsigned short)0, &ip)), double>::value), "");
247 static_assert((std::is_same<decltype(std::frexp((int)0, &ip)), double>::value), "");
248 static_assert((std::is_same<decltype(std::frexp((unsigned int)0, &ip)), double>::value), "");
249 static_assert((std::is_same<decltype(std::frexp((long)0, &ip)), double>::value), "");
250 static_assert((std::is_same<decltype(std::frexp((unsigned long)0, &ip)), double>::value), "");
251 static_assert((std::is_same<decltype(std::frexp((long long)0, &ip)), double>::value), "");
252 static_assert((std::is_same<decltype(std::frexp((unsigned long long)0, &ip)), double>::value), "");
253 static_assert((std::is_same<decltype(std::frexp((double)0, &ip)), double>::value), "");
254 static_assert((std::is_same<decltype(std::frexp((long double)0, &ip)), long double>::value), "");
255 static_assert((std::is_same<decltype(std::frexpf(0, &ip)), float>::value), "");
256 static_assert((std::is_same<decltype(std::frexpl(0, &ip)), long double>::value), "");
257 assert(std::frexp(0, &ip) == 0);
260 void test_ldexp()
262 int ip = 1;
263 static_assert((std::is_same<decltype(std::ldexp((float)0, ip)), float>::value), "");
264 static_assert((std::is_same<decltype(std::ldexp((bool)0, ip)), double>::value), "");
265 static_assert((std::is_same<decltype(std::ldexp((unsigned short)0, ip)), double>::value), "");
266 static_assert((std::is_same<decltype(std::ldexp((int)0, ip)), double>::value), "");
267 static_assert((std::is_same<decltype(std::ldexp((unsigned int)0, ip)), double>::value), "");
268 static_assert((std::is_same<decltype(std::ldexp((long)0, ip)), double>::value), "");
269 static_assert((std::is_same<decltype(std::ldexp((unsigned long)0, ip)), double>::value), "");
270 static_assert((std::is_same<decltype(std::ldexp((long long)0, ip)), double>::value), "");
271 static_assert((std::is_same<decltype(std::ldexp((unsigned long long)0, ip)), double>::value), "");
272 static_assert((std::is_same<decltype(std::ldexp((double)0, ip)), double>::value), "");
273 static_assert((std::is_same<decltype(std::ldexp((long double)0, ip)), long double>::value), "");
274 static_assert((std::is_same<decltype(std::ldexpf(0, ip)), float>::value), "");
275 static_assert((std::is_same<decltype(std::ldexpl(0, ip)), long double>::value), "");
276 assert(std::ldexp(1, ip) == 2);
279 void test_log()
281 static_assert((std::is_same<decltype(std::log((float)0)), float>::value), "");
282 static_assert((std::is_same<decltype(std::log((bool)0)), double>::value), "");
283 static_assert((std::is_same<decltype(std::log((unsigned short)0)), double>::value), "");
284 static_assert((std::is_same<decltype(std::log((int)0)), double>::value), "");
285 static_assert((std::is_same<decltype(std::log((unsigned int)0)), double>::value), "");
286 static_assert((std::is_same<decltype(std::log((long)0)), double>::value), "");
287 static_assert((std::is_same<decltype(std::log((unsigned long)0)), double>::value), "");
288 static_assert((std::is_same<decltype(std::log((long long)0)), double>::value), "");
289 static_assert((std::is_same<decltype(std::log((unsigned long long)0)), double>::value), "");
290 static_assert((std::is_same<decltype(std::log((double)0)), double>::value), "");
291 static_assert((std::is_same<decltype(std::log((long double)0)), long double>::value), "");
292 static_assert((std::is_same<decltype(std::logf(0)), float>::value), "");
293 static_assert((std::is_same<decltype(std::logl(0)), long double>::value), "");
294 assert(std::log(1) == 0);
297 void test_log10()
299 static_assert((std::is_same<decltype(std::log10((float)0)), float>::value), "");
300 static_assert((std::is_same<decltype(std::log10((bool)0)), double>::value), "");
301 static_assert((std::is_same<decltype(std::log10((unsigned short)0)), double>::value), "");
302 static_assert((std::is_same<decltype(std::log10((int)0)), double>::value), "");
303 static_assert((std::is_same<decltype(std::log10((unsigned int)0)), double>::value), "");
304 static_assert((std::is_same<decltype(std::log10((long)0)), double>::value), "");
305 static_assert((std::is_same<decltype(std::log10((unsigned long)0)), double>::value), "");
306 static_assert((std::is_same<decltype(std::log10((long long)0)), double>::value), "");
307 static_assert((std::is_same<decltype(std::log10((unsigned long long)0)), double>::value), "");
308 static_assert((std::is_same<decltype(std::log10((double)0)), double>::value), "");
309 static_assert((std::is_same<decltype(std::log10((long double)0)), long double>::value), "");
310 static_assert((std::is_same<decltype(std::log10f(0)), float>::value), "");
311 static_assert((std::is_same<decltype(std::log10l(0)), long double>::value), "");
312 assert(std::log10(1) == 0);
315 void test_modf()
317 static_assert((std::is_same<decltype(std::modf((float)0, (float*)0)), float>::value), "");
318 static_assert((std::is_same<decltype(std::modf((double)0, (double*)0)), double>::value), "");
319 static_assert((std::is_same<decltype(std::modf((long double)0, (long double*)0)), long double>::value), "");
320 static_assert((std::is_same<decltype(std::modff(0, (float*)0)), float>::value), "");
321 static_assert((std::is_same<decltype(std::modfl(0, (long double*)0)), long double>::value), "");
322 double i;
323 assert(std::modf(1., &i) == 0);
326 void test_pow()
328 static_assert((std::is_same<decltype(std::pow((float)0, (float)0)), float>::value), "");
329 static_assert((std::is_same<decltype(std::pow((bool)0, (float)0)), double>::value), "");
330 static_assert((std::is_same<decltype(std::pow((unsigned short)0, (double)0)), double>::value), "");
331 static_assert((std::is_same<decltype(std::pow((int)0, (long double)0)), long double>::value), "");
332 static_assert((std::is_same<decltype(std::pow((float)0, (unsigned int)0)), double>::value), "");
333 static_assert((std::is_same<decltype(std::pow((double)0, (long)0)), double>::value), "");
334 static_assert((std::is_same<decltype(std::pow((long double)0, (unsigned long)0)), long double>::value), "");
335 static_assert((std::is_same<decltype(std::pow((int)0, (long long)0)), double>::value), "");
336 static_assert((std::is_same<decltype(std::pow((int)0, (unsigned long long)0)), double>::value), "");
337 static_assert((std::is_same<decltype(std::pow((double)0, (double)0)), double>::value), "");
338 static_assert((std::is_same<decltype(std::pow((long double)0, (long double)0)), long double>::value), "");
339 static_assert((std::is_same<decltype(std::pow((float)0, (double)0)), double>::value), "");
340 static_assert((std::is_same<decltype(std::pow((float)0, (long double)0)), long double>::value), "");
341 static_assert((std::is_same<decltype(std::pow((double)0, (long double)0)), long double>::value), "");
342 static_assert((std::is_same<decltype(std::powf(0,0)), float>::value), "");
343 static_assert((std::is_same<decltype(std::powl(0,0)), long double>::value), "");
344 static_assert((std::is_same<decltype(std::pow((int)0, (int)0)), double>::value), "");
345 // static_assert((std::is_same<decltype(std::pow(Value<int>(), (int)0)), double>::value), "");
346 // static_assert((std::is_same<decltype(std::pow(Value<long double>(), (float)0)), long double>::value), "");
347 // static_assert((std::is_same<decltype(std::pow((float) 0, Value<float>())), float>::value), "");
348 assert(std::pow(1,1) == 1);
349 // assert(std::pow(Value<int,1>(), Value<float,1>()) == 1);
350 // assert(std::pow(1.0f, Value<double,1>()) == 1);
351 // assert(std::pow(1.0, Value<int,1>()) == 1);
352 // assert(std::pow(Value<long double,1>(), 1LL) == 1);
355 void test_sin()
357 static_assert((std::is_same<decltype(std::sin((float)0)), float>::value), "");
358 static_assert((std::is_same<decltype(std::sin((bool)0)), double>::value), "");
359 static_assert((std::is_same<decltype(std::sin((unsigned short)0)), double>::value), "");
360 static_assert((std::is_same<decltype(std::sin((int)0)), double>::value), "");
361 static_assert((std::is_same<decltype(std::sin((unsigned int)0)), double>::value), "");
362 static_assert((std::is_same<decltype(std::sin((long)0)), double>::value), "");
363 static_assert((std::is_same<decltype(std::sin((unsigned long)0)), double>::value), "");
364 static_assert((std::is_same<decltype(std::sin((long long)0)), double>::value), "");
365 static_assert((std::is_same<decltype(std::sin((unsigned long long)0)), double>::value), "");
366 static_assert((std::is_same<decltype(std::sin((double)0)), double>::value), "");
367 static_assert((std::is_same<decltype(std::sin((long double)0)), long double>::value), "");
368 static_assert((std::is_same<decltype(std::sinf(0)), float>::value), "");
369 static_assert((std::is_same<decltype(std::sinl(0)), long double>::value), "");
370 assert(std::sin(0) == 0);
373 void test_sinh()
375 static_assert((std::is_same<decltype(std::sinh((float)0)), float>::value), "");
376 static_assert((std::is_same<decltype(std::sinh((bool)0)), double>::value), "");
377 static_assert((std::is_same<decltype(std::sinh((unsigned short)0)), double>::value), "");
378 static_assert((std::is_same<decltype(std::sinh((int)0)), double>::value), "");
379 static_assert((std::is_same<decltype(std::sinh((unsigned int)0)), double>::value), "");
380 static_assert((std::is_same<decltype(std::sinh((long)0)), double>::value), "");
381 static_assert((std::is_same<decltype(std::sinh((unsigned long)0)), double>::value), "");
382 static_assert((std::is_same<decltype(std::sinh((long long)0)), double>::value), "");
383 static_assert((std::is_same<decltype(std::sinh((unsigned long long)0)), double>::value), "");
384 static_assert((std::is_same<decltype(std::sinh((double)0)), double>::value), "");
385 static_assert((std::is_same<decltype(std::sinh((long double)0)), long double>::value), "");
386 static_assert((std::is_same<decltype(std::sinhf(0)), float>::value), "");
387 static_assert((std::is_same<decltype(std::sinhl(0)), long double>::value), "");
388 assert(std::sinh(0) == 0);
391 void test_sqrt()
393 static_assert((std::is_same<decltype(std::sqrt((float)0)), float>::value), "");
394 static_assert((std::is_same<decltype(std::sqrt((bool)0)), double>::value), "");
395 static_assert((std::is_same<decltype(std::sqrt((unsigned short)0)), double>::value), "");
396 static_assert((std::is_same<decltype(std::sqrt((int)0)), double>::value), "");
397 static_assert((std::is_same<decltype(std::sqrt((unsigned int)0)), double>::value), "");
398 static_assert((std::is_same<decltype(std::sqrt((long)0)), double>::value), "");
399 static_assert((std::is_same<decltype(std::sqrt((unsigned long)0)), double>::value), "");
400 static_assert((std::is_same<decltype(std::sqrt((long long)0)), double>::value), "");
401 static_assert((std::is_same<decltype(std::sqrt((unsigned long long)0)), double>::value), "");
402 static_assert((std::is_same<decltype(std::sqrt((double)0)), double>::value), "");
403 static_assert((std::is_same<decltype(std::sqrt((long double)0)), long double>::value), "");
404 static_assert((std::is_same<decltype(std::sqrtf(0)), float>::value), "");
405 static_assert((std::is_same<decltype(std::sqrtl(0)), long double>::value), "");
406 assert(std::sqrt(4) == 2);
409 void test_tan()
411 static_assert((std::is_same<decltype(std::tan((float)0)), float>::value), "");
412 static_assert((std::is_same<decltype(std::tan((bool)0)), double>::value), "");
413 static_assert((std::is_same<decltype(std::tan((unsigned short)0)), double>::value), "");
414 static_assert((std::is_same<decltype(std::tan((int)0)), double>::value), "");
415 static_assert((std::is_same<decltype(std::tan((unsigned int)0)), double>::value), "");
416 static_assert((std::is_same<decltype(std::tan((long)0)), double>::value), "");
417 static_assert((std::is_same<decltype(std::tan((unsigned long)0)), double>::value), "");
418 static_assert((std::is_same<decltype(std::tan((long long)0)), double>::value), "");
419 static_assert((std::is_same<decltype(std::tan((unsigned long long)0)), double>::value), "");
420 static_assert((std::is_same<decltype(std::tan((double)0)), double>::value), "");
421 static_assert((std::is_same<decltype(std::tan((long double)0)), long double>::value), "");
422 static_assert((std::is_same<decltype(std::tanf(0)), float>::value), "");
423 static_assert((std::is_same<decltype(std::tanl(0)), long double>::value), "");
424 assert(std::tan(0) == 0);
427 void test_tanh()
429 static_assert((std::is_same<decltype(std::tanh((float)0)), float>::value), "");
430 static_assert((std::is_same<decltype(std::tanh((bool)0)), double>::value), "");
431 static_assert((std::is_same<decltype(std::tanh((unsigned short)0)), double>::value), "");
432 static_assert((std::is_same<decltype(std::tanh((int)0)), double>::value), "");
433 static_assert((std::is_same<decltype(std::tanh((unsigned int)0)), double>::value), "");
434 static_assert((std::is_same<decltype(std::tanh((long)0)), double>::value), "");
435 static_assert((std::is_same<decltype(std::tanh((unsigned long)0)), double>::value), "");
436 static_assert((std::is_same<decltype(std::tanh((long long)0)), double>::value), "");
437 static_assert((std::is_same<decltype(std::tanh((unsigned long long)0)), double>::value), "");
438 static_assert((std::is_same<decltype(std::tanh((double)0)), double>::value), "");
439 static_assert((std::is_same<decltype(std::tanh((long double)0)), long double>::value), "");
440 static_assert((std::is_same<decltype(std::tanhf(0)), float>::value), "");
441 static_assert((std::is_same<decltype(std::tanhl(0)), long double>::value), "");
442 assert(std::tanh(0) == 0);
445 void test_signbit()
447 #ifdef signbit
448 #error signbit defined
449 #endif
450 static_assert((std::is_same<decltype(std::signbit((float)0)), bool>::value), "");
451 static_assert((std::is_same<decltype(std::signbit((double)0)), bool>::value), "");
452 static_assert((std::is_same<decltype(std::signbit(0)), bool>::value), "");
453 static_assert((std::is_same<decltype(std::signbit((long double)0)), bool>::value), "");
454 assert(std::signbit(-1.0) == true);
457 void test_fpclassify()
459 #ifdef fpclassify
460 #error fpclassify defined
461 #endif
462 static_assert((std::is_same<decltype(std::fpclassify((float)0)), int>::value), "");
463 static_assert((std::is_same<decltype(std::fpclassify((double)0)), int>::value), "");
464 static_assert((std::is_same<decltype(std::fpclassify(0)), int>::value), "");
465 static_assert((std::is_same<decltype(std::fpclassify((long double)0)), int>::value), "");
466 assert(std::fpclassify(-1.0) == FP_NORMAL);
469 void test_isfinite()
471 #ifdef isfinite
472 #error isfinite defined
473 #endif
474 static_assert((std::is_same<decltype(std::isfinite((float)0)), bool>::value), "");
475 static_assert((std::is_same<decltype(std::isfinite((double)0)), bool>::value), "");
476 static_assert((std::is_same<decltype(std::isfinite(0)), bool>::value), "");
477 static_assert((std::is_same<decltype(std::isfinite((long double)0)), bool>::value), "");
478 assert(std::isfinite(-1.0) == true);
481 void test_isnormal()
483 #ifdef isnormal
484 #error isnormal defined
485 #endif
486 static_assert((std::is_same<decltype(std::isnormal((float)0)), bool>::value), "");
487 static_assert((std::is_same<decltype(std::isnormal((double)0)), bool>::value), "");
488 static_assert((std::is_same<decltype(std::isnormal(0)), bool>::value), "");
489 static_assert((std::is_same<decltype(std::isnormal((long double)0)), bool>::value), "");
490 assert(std::isnormal(-1.0) == true);
493 void test_isgreater()
495 #ifdef isgreater
496 #error isgreater defined
497 #endif
498 static_assert((std::is_same<decltype(std::isgreater((float)0, (float)0)), bool>::value), "");
499 static_assert((std::is_same<decltype(std::isgreater((float)0, (double)0)), bool>::value), "");
500 static_assert((std::is_same<decltype(std::isgreater((float)0, (long double)0)), bool>::value), "");
501 static_assert((std::is_same<decltype(std::isgreater((double)0, (float)0)), bool>::value), "");
502 static_assert((std::is_same<decltype(std::isgreater((double)0, (double)0)), bool>::value), "");
503 static_assert((std::is_same<decltype(std::isgreater(0, (double)0)), bool>::value), "");
504 static_assert((std::is_same<decltype(std::isgreater((double)0, (long double)0)), bool>::value), "");
505 static_assert((std::is_same<decltype(std::isgreater((long double)0, (float)0)), bool>::value), "");
506 static_assert((std::is_same<decltype(std::isgreater((long double)0, (double)0)), bool>::value), "");
507 static_assert((std::is_same<decltype(std::isgreater((long double)0, (long double)0)), bool>::value), "");
508 assert(std::isgreater(-1.0, 0.F) == false);
511 void test_isgreaterequal()
513 #ifdef isgreaterequal
514 #error isgreaterequal defined
515 #endif
516 static_assert((std::is_same<decltype(std::isgreaterequal((float)0, (float)0)), bool>::value), "");
517 static_assert((std::is_same<decltype(std::isgreaterequal((float)0, (double)0)), bool>::value), "");
518 static_assert((std::is_same<decltype(std::isgreaterequal((float)0, (long double)0)), bool>::value), "");
519 static_assert((std::is_same<decltype(std::isgreaterequal((double)0, (float)0)), bool>::value), "");
520 static_assert((std::is_same<decltype(std::isgreaterequal((double)0, (double)0)), bool>::value), "");
521 static_assert((std::is_same<decltype(std::isgreaterequal(0, (double)0)), bool>::value), "");
522 static_assert((std::is_same<decltype(std::isgreaterequal((double)0, (long double)0)), bool>::value), "");
523 static_assert((std::is_same<decltype(std::isgreaterequal((long double)0, (float)0)), bool>::value), "");
524 static_assert((std::is_same<decltype(std::isgreaterequal((long double)0, (double)0)), bool>::value), "");
525 static_assert((std::is_same<decltype(std::isgreaterequal((long double)0, (long double)0)), bool>::value), "");
526 assert(std::isgreaterequal(-1.0, 0.F) == false);
529 void test_isless()
531 #ifdef isless
532 #error isless defined
533 #endif
534 static_assert((std::is_same<decltype(std::isless((float)0, (float)0)), bool>::value), "");
535 static_assert((std::is_same<decltype(std::isless((float)0, (double)0)), bool>::value), "");
536 static_assert((std::is_same<decltype(std::isless((float)0, (long double)0)), bool>::value), "");
537 static_assert((std::is_same<decltype(std::isless((double)0, (float)0)), bool>::value), "");
538 static_assert((std::is_same<decltype(std::isless((double)0, (double)0)), bool>::value), "");
539 static_assert((std::is_same<decltype(std::isless(0, (double)0)), bool>::value), "");
540 static_assert((std::is_same<decltype(std::isless((double)0, (long double)0)), bool>::value), "");
541 static_assert((std::is_same<decltype(std::isless((long double)0, (float)0)), bool>::value), "");
542 static_assert((std::is_same<decltype(std::isless((long double)0, (double)0)), bool>::value), "");
543 static_assert((std::is_same<decltype(std::isless((long double)0, (long double)0)), bool>::value), "");
544 assert(std::isless(-1.0, 0.F) == true);
547 void test_islessequal()
549 #ifdef islessequal
550 #error islessequal defined
551 #endif
552 static_assert((std::is_same<decltype(std::islessequal((float)0, (float)0)), bool>::value), "");
553 static_assert((std::is_same<decltype(std::islessequal((float)0, (double)0)), bool>::value), "");
554 static_assert((std::is_same<decltype(std::islessequal((float)0, (long double)0)), bool>::value), "");
555 static_assert((std::is_same<decltype(std::islessequal((double)0, (float)0)), bool>::value), "");
556 static_assert((std::is_same<decltype(std::islessequal((double)0, (double)0)), bool>::value), "");
557 static_assert((std::is_same<decltype(std::islessequal(0, (double)0)), bool>::value), "");
558 static_assert((std::is_same<decltype(std::islessequal((double)0, (long double)0)), bool>::value), "");
559 static_assert((std::is_same<decltype(std::islessequal((long double)0, (float)0)), bool>::value), "");
560 static_assert((std::is_same<decltype(std::islessequal((long double)0, (double)0)), bool>::value), "");
561 static_assert((std::is_same<decltype(std::islessequal((long double)0, (long double)0)), bool>::value), "");
562 assert(std::islessequal(-1.0, 0.F) == true);
565 void test_islessgreater()
567 #ifdef islessgreater
568 #error islessgreater defined
569 #endif
570 static_assert((std::is_same<decltype(std::islessgreater((float)0, (float)0)), bool>::value), "");
571 static_assert((std::is_same<decltype(std::islessgreater((float)0, (double)0)), bool>::value), "");
572 static_assert((std::is_same<decltype(std::islessgreater((float)0, (long double)0)), bool>::value), "");
573 static_assert((std::is_same<decltype(std::islessgreater((double)0, (float)0)), bool>::value), "");
574 static_assert((std::is_same<decltype(std::islessgreater((double)0, (double)0)), bool>::value), "");
575 static_assert((std::is_same<decltype(std::islessgreater(0, (double)0)), bool>::value), "");
576 static_assert((std::is_same<decltype(std::islessgreater((double)0, (long double)0)), bool>::value), "");
577 static_assert((std::is_same<decltype(std::islessgreater((long double)0, (float)0)), bool>::value), "");
578 static_assert((std::is_same<decltype(std::islessgreater((long double)0, (double)0)), bool>::value), "");
579 static_assert((std::is_same<decltype(std::islessgreater((long double)0, (long double)0)), bool>::value), "");
580 assert(std::islessgreater(-1.0, 0.F) == true);
583 void test_isunordered()
585 #ifdef isunordered
586 #error isunordered defined
587 #endif
588 static_assert((std::is_same<decltype(std::isunordered((float)0, (float)0)), bool>::value), "");
589 static_assert((std::is_same<decltype(std::isunordered((float)0, (double)0)), bool>::value), "");
590 static_assert((std::is_same<decltype(std::isunordered((float)0, (long double)0)), bool>::value), "");
591 static_assert((std::is_same<decltype(std::isunordered((double)0, (float)0)), bool>::value), "");
592 static_assert((std::is_same<decltype(std::isunordered((double)0, (double)0)), bool>::value), "");
593 static_assert((std::is_same<decltype(std::isunordered(0, (double)0)), bool>::value), "");
594 static_assert((std::is_same<decltype(std::isunordered((double)0, (long double)0)), bool>::value), "");
595 static_assert((std::is_same<decltype(std::isunordered((long double)0, (float)0)), bool>::value), "");
596 static_assert((std::is_same<decltype(std::isunordered((long double)0, (double)0)), bool>::value), "");
597 static_assert((std::is_same<decltype(std::isunordered((long double)0, (long double)0)), bool>::value), "");
598 assert(std::isunordered(-1.0, 0.F) == false);
601 void test_acosh()
603 static_assert((std::is_same<decltype(std::acosh((float)0)), float>::value), "");
604 static_assert((std::is_same<decltype(std::acosh((bool)0)), double>::value), "");
605 static_assert((std::is_same<decltype(std::acosh((unsigned short)0)), double>::value), "");
606 static_assert((std::is_same<decltype(std::acosh((int)0)), double>::value), "");
607 static_assert((std::is_same<decltype(std::acosh((unsigned int)0)), double>::value), "");
608 static_assert((std::is_same<decltype(std::acosh((long)0)), double>::value), "");
609 static_assert((std::is_same<decltype(std::acosh((unsigned long)0)), double>::value), "");
610 static_assert((std::is_same<decltype(std::acosh((long long)0)), double>::value), "");
611 static_assert((std::is_same<decltype(std::acosh((unsigned long long)0)), double>::value), "");
612 static_assert((std::is_same<decltype(std::acosh((double)0)), double>::value), "");
613 static_assert((std::is_same<decltype(std::acosh((long double)0)), long double>::value), "");
614 static_assert((std::is_same<decltype(std::acoshf(0)), float>::value), "");
615 static_assert((std::is_same<decltype(std::acoshl(0)), long double>::value), "");
616 assert(std::acosh(1) == 0);
619 void test_asinh()
621 static_assert((std::is_same<decltype(std::asinh((float)0)), float>::value), "");
622 static_assert((std::is_same<decltype(std::asinh((bool)0)), double>::value), "");
623 static_assert((std::is_same<decltype(std::asinh((unsigned short)0)), double>::value), "");
624 static_assert((std::is_same<decltype(std::asinh((int)0)), double>::value), "");
625 static_assert((std::is_same<decltype(std::asinh((unsigned int)0)), double>::value), "");
626 static_assert((std::is_same<decltype(std::asinh((long)0)), double>::value), "");
627 static_assert((std::is_same<decltype(std::asinh((unsigned long)0)), double>::value), "");
628 static_assert((std::is_same<decltype(std::asinh((long long)0)), double>::value), "");
629 static_assert((std::is_same<decltype(std::asinh((unsigned long long)0)), double>::value), "");
630 static_assert((std::is_same<decltype(std::asinh((double)0)), double>::value), "");
631 static_assert((std::is_same<decltype(std::asinh((long double)0)), long double>::value), "");
632 static_assert((std::is_same<decltype(std::asinhf(0)), float>::value), "");
633 static_assert((std::is_same<decltype(std::asinhl(0)), long double>::value), "");
634 assert(std::asinh(0) == 0);
637 void test_atanh()
639 static_assert((std::is_same<decltype(std::atanh((float)0)), float>::value), "");
640 static_assert((std::is_same<decltype(std::atanh((bool)0)), double>::value), "");
641 static_assert((std::is_same<decltype(std::atanh((unsigned short)0)), double>::value), "");
642 static_assert((std::is_same<decltype(std::atanh((int)0)), double>::value), "");
643 static_assert((std::is_same<decltype(std::atanh((unsigned int)0)), double>::value), "");
644 static_assert((std::is_same<decltype(std::atanh((long)0)), double>::value), "");
645 static_assert((std::is_same<decltype(std::atanh((unsigned long)0)), double>::value), "");
646 static_assert((std::is_same<decltype(std::atanh((long long)0)), double>::value), "");
647 static_assert((std::is_same<decltype(std::atanh((unsigned long long)0)), double>::value), "");
648 static_assert((std::is_same<decltype(std::atanh((double)0)), double>::value), "");
649 static_assert((std::is_same<decltype(std::atanh((long double)0)), long double>::value), "");
650 static_assert((std::is_same<decltype(std::atanhf(0)), float>::value), "");
651 static_assert((std::is_same<decltype(std::atanhl(0)), long double>::value), "");
652 assert(std::atanh(0) == 0);
655 void test_cbrt()
657 static_assert((std::is_same<decltype(std::cbrt((float)0)), float>::value), "");
658 static_assert((std::is_same<decltype(std::cbrt((bool)0)), double>::value), "");
659 static_assert((std::is_same<decltype(std::cbrt((unsigned short)0)), double>::value), "");
660 static_assert((std::is_same<decltype(std::cbrt((int)0)), double>::value), "");
661 static_assert((std::is_same<decltype(std::cbrt((unsigned int)0)), double>::value), "");
662 static_assert((std::is_same<decltype(std::cbrt((long)0)), double>::value), "");
663 static_assert((std::is_same<decltype(std::cbrt((unsigned long)0)), double>::value), "");
664 static_assert((std::is_same<decltype(std::cbrt((long long)0)), double>::value), "");
665 static_assert((std::is_same<decltype(std::cbrt((unsigned long long)0)), double>::value), "");
666 static_assert((std::is_same<decltype(std::cbrt((double)0)), double>::value), "");
667 static_assert((std::is_same<decltype(std::cbrt((long double)0)), long double>::value), "");
668 static_assert((std::is_same<decltype(std::cbrtf(0)), float>::value), "");
669 static_assert((std::is_same<decltype(std::cbrtl(0)), long double>::value), "");
670 assert(std::cbrt(1) == 1);
673 void test_copysign()
675 static_assert((std::is_same<decltype(std::copysign((float)0, (float)0)), float>::value), "");
676 static_assert((std::is_same<decltype(std::copysign((bool)0, (float)0)), double>::value), "");
677 static_assert((std::is_same<decltype(std::copysign((unsigned short)0, (double)0)), double>::value), "");
678 static_assert((std::is_same<decltype(std::copysign((int)0, (long double)0)), long double>::value), "");
679 static_assert((std::is_same<decltype(std::copysign((float)0, (unsigned int)0)), double>::value), "");
680 static_assert((std::is_same<decltype(std::copysign((double)0, (long)0)), double>::value), "");
681 static_assert((std::is_same<decltype(std::copysign((long double)0, (unsigned long)0)), long double>::value), "");
682 static_assert((std::is_same<decltype(std::copysign((int)0, (long long)0)), double>::value), "");
683 static_assert((std::is_same<decltype(std::copysign((int)0, (unsigned long long)0)), double>::value), "");
684 static_assert((std::is_same<decltype(std::copysign((double)0, (double)0)), double>::value), "");
685 static_assert((std::is_same<decltype(std::copysign((long double)0, (long double)0)), long double>::value), "");
686 static_assert((std::is_same<decltype(std::copysign((float)0, (double)0)), double>::value), "");
687 static_assert((std::is_same<decltype(std::copysign((float)0, (long double)0)), long double>::value), "");
688 static_assert((std::is_same<decltype(std::copysign((double)0, (long double)0)), long double>::value), "");
689 static_assert((std::is_same<decltype(std::copysignf(0,0)), float>::value), "");
690 static_assert((std::is_same<decltype(std::copysignl(0,0)), long double>::value), "");
691 static_assert((std::is_same<decltype(std::copysign((int)0, (int)0)), double>::value), "");
692 assert(std::copysign(1,1) == 1);
695 void test_erf()
697 static_assert((std::is_same<decltype(std::erf((float)0)), float>::value), "");
698 static_assert((std::is_same<decltype(std::erf((bool)0)), double>::value), "");
699 static_assert((std::is_same<decltype(std::erf((unsigned short)0)), double>::value), "");
700 static_assert((std::is_same<decltype(std::erf((int)0)), double>::value), "");
701 static_assert((std::is_same<decltype(std::erf((unsigned int)0)), double>::value), "");
702 static_assert((std::is_same<decltype(std::erf((long)0)), double>::value), "");
703 static_assert((std::is_same<decltype(std::erf((unsigned long)0)), double>::value), "");
704 static_assert((std::is_same<decltype(std::erf((long long)0)), double>::value), "");
705 static_assert((std::is_same<decltype(std::erf((unsigned long long)0)), double>::value), "");
706 static_assert((std::is_same<decltype(std::erf((double)0)), double>::value), "");
707 static_assert((std::is_same<decltype(std::erf((long double)0)), long double>::value), "");
708 static_assert((std::is_same<decltype(std::erff(0)), float>::value), "");
709 static_assert((std::is_same<decltype(std::erfl(0)), long double>::value), "");
710 assert(std::erf(0) == 0);
713 void test_erfc()
715 static_assert((std::is_same<decltype(std::erfc((float)0)), float>::value), "");
716 static_assert((std::is_same<decltype(std::erfc((bool)0)), double>::value), "");
717 static_assert((std::is_same<decltype(std::erfc((unsigned short)0)), double>::value), "");
718 static_assert((std::is_same<decltype(std::erfc((int)0)), double>::value), "");
719 static_assert((std::is_same<decltype(std::erfc((unsigned int)0)), double>::value), "");
720 static_assert((std::is_same<decltype(std::erfc((long)0)), double>::value), "");
721 static_assert((std::is_same<decltype(std::erfc((unsigned long)0)), double>::value), "");
722 static_assert((std::is_same<decltype(std::erfc((long long)0)), double>::value), "");
723 static_assert((std::is_same<decltype(std::erfc((unsigned long long)0)), double>::value), "");
724 static_assert((std::is_same<decltype(std::erfc((double)0)), double>::value), "");
725 static_assert((std::is_same<decltype(std::erfc((long double)0)), long double>::value), "");
726 static_assert((std::is_same<decltype(std::erfcf(0)), float>::value), "");
727 static_assert((std::is_same<decltype(std::erfcl(0)), long double>::value), "");
728 assert(std::erfc(0) == 1);
731 void test_exp2()
733 static_assert((std::is_same<decltype(std::exp2((float)0)), float>::value), "");
734 static_assert((std::is_same<decltype(std::exp2((bool)0)), double>::value), "");
735 static_assert((std::is_same<decltype(std::exp2((unsigned short)0)), double>::value), "");
736 static_assert((std::is_same<decltype(std::exp2((int)0)), double>::value), "");
737 static_assert((std::is_same<decltype(std::exp2((unsigned int)0)), double>::value), "");
738 static_assert((std::is_same<decltype(std::exp2((long)0)), double>::value), "");
739 static_assert((std::is_same<decltype(std::exp2((unsigned long)0)), double>::value), "");
740 static_assert((std::is_same<decltype(std::exp2((long long)0)), double>::value), "");
741 static_assert((std::is_same<decltype(std::exp2((unsigned long long)0)), double>::value), "");
742 static_assert((std::is_same<decltype(std::exp2((double)0)), double>::value), "");
743 static_assert((std::is_same<decltype(std::exp2((long double)0)), long double>::value), "");
744 static_assert((std::is_same<decltype(std::exp2f(0)), float>::value), "");
745 static_assert((std::is_same<decltype(std::exp2l(0)), long double>::value), "");
746 assert(std::exp2(1) == 2);
749 void test_expm1()
751 static_assert((std::is_same<decltype(std::expm1((float)0)), float>::value), "");
752 static_assert((std::is_same<decltype(std::expm1((bool)0)), double>::value), "");
753 static_assert((std::is_same<decltype(std::expm1((unsigned short)0)), double>::value), "");
754 static_assert((std::is_same<decltype(std::expm1((int)0)), double>::value), "");
755 static_assert((std::is_same<decltype(std::expm1((unsigned int)0)), double>::value), "");
756 static_assert((std::is_same<decltype(std::expm1((long)0)), double>::value), "");
757 static_assert((std::is_same<decltype(std::expm1((unsigned long)0)), double>::value), "");
758 static_assert((std::is_same<decltype(std::expm1((long long)0)), double>::value), "");
759 static_assert((std::is_same<decltype(std::expm1((unsigned long long)0)), double>::value), "");
760 static_assert((std::is_same<decltype(std::expm1((double)0)), double>::value), "");
761 static_assert((std::is_same<decltype(std::expm1((long double)0)), long double>::value), "");
762 static_assert((std::is_same<decltype(std::expm1f(0)), float>::value), "");
763 static_assert((std::is_same<decltype(std::expm1l(0)), long double>::value), "");
764 assert(std::expm1(0) == 0);
767 void test_fdim()
769 static_assert((std::is_same<decltype(std::fdim((float)0, (float)0)), float>::value), "");
770 static_assert((std::is_same<decltype(std::fdim((bool)0, (float)0)), double>::value), "");
771 static_assert((std::is_same<decltype(std::fdim((unsigned short)0, (double)0)), double>::value), "");
772 static_assert((std::is_same<decltype(std::fdim((int)0, (long double)0)), long double>::value), "");
773 static_assert((std::is_same<decltype(std::fdim((float)0, (unsigned int)0)), double>::value), "");
774 static_assert((std::is_same<decltype(std::fdim((double)0, (long)0)), double>::value), "");
775 static_assert((std::is_same<decltype(std::fdim((long double)0, (unsigned long)0)), long double>::value), "");
776 static_assert((std::is_same<decltype(std::fdim((int)0, (long long)0)), double>::value), "");
777 static_assert((std::is_same<decltype(std::fdim((int)0, (unsigned long long)0)), double>::value), "");
778 static_assert((std::is_same<decltype(std::fdim((double)0, (double)0)), double>::value), "");
779 static_assert((std::is_same<decltype(std::fdim((long double)0, (long double)0)), long double>::value), "");
780 static_assert((std::is_same<decltype(std::fdim((float)0, (double)0)), double>::value), "");
781 static_assert((std::is_same<decltype(std::fdim((float)0, (long double)0)), long double>::value), "");
782 static_assert((std::is_same<decltype(std::fdim((double)0, (long double)0)), long double>::value), "");
783 static_assert((std::is_same<decltype(std::fdimf(0,0)), float>::value), "");
784 static_assert((std::is_same<decltype(std::fdiml(0,0)), long double>::value), "");
785 static_assert((std::is_same<decltype(std::fdim((int)0, (int)0)), double>::value), "");
786 assert(std::fdim(1,0) == 1);
789 void test_fma()
791 static_assert((std::is_same<decltype(std::fma((bool)0, (float)0, (float)0)), double>::value), "");
792 static_assert((std::is_same<decltype(std::fma((char)0, (float)0, (float)0)), double>::value), "");
793 static_assert((std::is_same<decltype(std::fma((unsigned)0, (float)0, (float)0)), double>::value), "");
794 static_assert((std::is_same<decltype(std::fma((float)0, (int)0, (float)0)), double>::value), "");
795 static_assert((std::is_same<decltype(std::fma((float)0, (long)0, (float)0)), double>::value), "");
796 static_assert((std::is_same<decltype(std::fma((float)0, (float)0, (unsigned long long)0)), double>::value), "");
797 static_assert((std::is_same<decltype(std::fma((float)0, (float)0, (double)0)), double>::value), "");
798 static_assert((std::is_same<decltype(std::fma((float)0, (float)0, (long double)0)), long double>::value), "");
799 static_assert((std::is_same<decltype(std::fma((float)0, (float)0, (float)0)), float>::value), "");
801 static_assert((std::is_same<decltype(std::fma((bool)0, (double)0, (double)0)), double>::value), "");
802 static_assert((std::is_same<decltype(std::fma((char)0, (double)0, (double)0)), double>::value), "");
803 static_assert((std::is_same<decltype(std::fma((unsigned)0, (double)0, (double)0)), double>::value), "");
804 static_assert((std::is_same<decltype(std::fma((double)0, (int)0, (double)0)), double>::value), "");
805 static_assert((std::is_same<decltype(std::fma((double)0, (long)0, (double)0)), double>::value), "");
806 static_assert((std::is_same<decltype(std::fma((double)0, (double)0, (unsigned long long)0)), double>::value), "");
807 static_assert((std::is_same<decltype(std::fma((double)0, (double)0, (float)0)), double>::value), "");
808 static_assert((std::is_same<decltype(std::fma((double)0, (double)0, (long double)0)), long double>::value), "");
809 static_assert((std::is_same<decltype(std::fma((double)0, (double)0, (double)0)), double>::value), "");
811 static_assert((std::is_same<decltype(std::fma((bool)0, (long double)0, (long double)0)), long double>::value), "");
812 static_assert((std::is_same<decltype(std::fma((char)0, (long double)0, (long double)0)), long double>::value), "");
813 static_assert((std::is_same<decltype(std::fma((unsigned)0, (long double)0, (long double)0)), long double>::value), "");
814 static_assert((std::is_same<decltype(std::fma((long double)0, (int)0, (long double)0)), long double>::value), "");
815 static_assert((std::is_same<decltype(std::fma((long double)0, (long)0, (long double)0)), long double>::value), "");
816 static_assert((std::is_same<decltype(std::fma((long double)0, (long double)0, (unsigned long long)0)), long double>::value), "");
817 static_assert((std::is_same<decltype(std::fma((long double)0, (long double)0, (float)0)), long double>::value), "");
818 static_assert((std::is_same<decltype(std::fma((double)0, (long double)0, (long double)0)), long double>::value), "");
819 static_assert((std::is_same<decltype(std::fma((long double)0, (long double)0, (long double)0)), long double>::value), "");
821 static_assert((std::is_same<decltype(std::fmaf(0,0,0)), float>::value), "");
822 static_assert((std::is_same<decltype(std::fmal(0,0,0)), long double>::value), "");
823 assert(std::fma(1,1,1) == 2);
826 void test_fmax()
828 static_assert((std::is_same<decltype(std::fmax((float)0, (float)0)), float>::value), "");
829 static_assert((std::is_same<decltype(std::fmax((bool)0, (float)0)), double>::value), "");
830 static_assert((std::is_same<decltype(std::fmax((unsigned short)0, (double)0)), double>::value), "");
831 static_assert((std::is_same<decltype(std::fmax((int)0, (long double)0)), long double>::value), "");
832 static_assert((std::is_same<decltype(std::fmax((float)0, (unsigned int)0)), double>::value), "");
833 static_assert((std::is_same<decltype(std::fmax((double)0, (long)0)), double>::value), "");
834 static_assert((std::is_same<decltype(std::fmax((long double)0, (unsigned long)0)), long double>::value), "");
835 static_assert((std::is_same<decltype(std::fmax((int)0, (long long)0)), double>::value), "");
836 static_assert((std::is_same<decltype(std::fmax((int)0, (unsigned long long)0)), double>::value), "");
837 static_assert((std::is_same<decltype(std::fmax((double)0, (double)0)), double>::value), "");
838 static_assert((std::is_same<decltype(std::fmax((long double)0, (long double)0)), long double>::value), "");
839 static_assert((std::is_same<decltype(std::fmax((float)0, (double)0)), double>::value), "");
840 static_assert((std::is_same<decltype(std::fmax((float)0, (long double)0)), long double>::value), "");
841 static_assert((std::is_same<decltype(std::fmax((double)0, (long double)0)), long double>::value), "");
842 static_assert((std::is_same<decltype(std::fmaxf(0,0)), float>::value), "");
843 static_assert((std::is_same<decltype(std::fmaxl(0,0)), long double>::value), "");
844 static_assert((std::is_same<decltype(std::fmax((int)0, (int)0)), double>::value), "");
845 assert(std::fmax(1,0) == 1);
848 void test_fmin()
850 static_assert((std::is_same<decltype(std::fmin((float)0, (float)0)), float>::value), "");
851 static_assert((std::is_same<decltype(std::fmin((bool)0, (float)0)), double>::value), "");
852 static_assert((std::is_same<decltype(std::fmin((unsigned short)0, (double)0)), double>::value), "");
853 static_assert((std::is_same<decltype(std::fmin((int)0, (long double)0)), long double>::value), "");
854 static_assert((std::is_same<decltype(std::fmin((float)0, (unsigned int)0)), double>::value), "");
855 static_assert((std::is_same<decltype(std::fmin((double)0, (long)0)), double>::value), "");
856 static_assert((std::is_same<decltype(std::fmin((long double)0, (unsigned long)0)), long double>::value), "");
857 static_assert((std::is_same<decltype(std::fmin((int)0, (long long)0)), double>::value), "");
858 static_assert((std::is_same<decltype(std::fmin((int)0, (unsigned long long)0)), double>::value), "");
859 static_assert((std::is_same<decltype(std::fmin((double)0, (double)0)), double>::value), "");
860 static_assert((std::is_same<decltype(std::fmin((long double)0, (long double)0)), long double>::value), "");
861 static_assert((std::is_same<decltype(std::fmin((float)0, (double)0)), double>::value), "");
862 static_assert((std::is_same<decltype(std::fmin((float)0, (long double)0)), long double>::value), "");
863 static_assert((std::is_same<decltype(std::fmin((double)0, (long double)0)), long double>::value), "");
864 static_assert((std::is_same<decltype(std::fminf(0,0)), float>::value), "");
865 static_assert((std::is_same<decltype(std::fminl(0,0)), long double>::value), "");
866 static_assert((std::is_same<decltype(std::fmin((int)0, (int)0)), double>::value), "");
867 assert(std::fmin(1,0) == 0);
870 void test_hypot()
872 static_assert((std::is_same<decltype(std::hypot((float)0, (float)0)), float>::value), "");
873 static_assert((std::is_same<decltype(std::hypot((bool)0, (float)0)), double>::value), "");
874 static_assert((std::is_same<decltype(std::hypot((unsigned short)0, (double)0)), double>::value), "");
875 static_assert((std::is_same<decltype(std::hypot((int)0, (long double)0)), long double>::value), "");
876 static_assert((std::is_same<decltype(std::hypot((float)0, (unsigned int)0)), double>::value), "");
877 static_assert((std::is_same<decltype(std::hypot((double)0, (long)0)), double>::value), "");
878 static_assert((std::is_same<decltype(std::hypot((long double)0, (unsigned long)0)), long double>::value), "");
879 static_assert((std::is_same<decltype(std::hypot((int)0, (long long)0)), double>::value), "");
880 static_assert((std::is_same<decltype(std::hypot((int)0, (unsigned long long)0)), double>::value), "");
881 static_assert((std::is_same<decltype(std::hypot((double)0, (double)0)), double>::value), "");
882 static_assert((std::is_same<decltype(std::hypot((long double)0, (long double)0)), long double>::value), "");
883 static_assert((std::is_same<decltype(std::hypot((float)0, (double)0)), double>::value), "");
884 static_assert((std::is_same<decltype(std::hypot((float)0, (long double)0)), long double>::value), "");
885 static_assert((std::is_same<decltype(std::hypot((double)0, (long double)0)), long double>::value), "");
886 static_assert((std::is_same<decltype(std::hypotf(0,0)), float>::value), "");
887 static_assert((std::is_same<decltype(std::hypotl(0,0)), long double>::value), "");
888 static_assert((std::is_same<decltype(std::hypot((int)0, (int)0)), double>::value), "");
889 assert(std::hypot(3,4) == 5);
892 void test_ilogb()
894 static_assert((std::is_same<decltype(std::ilogb((float)0)), int>::value), "");
895 static_assert((std::is_same<decltype(std::ilogb((bool)0)), int>::value), "");
896 static_assert((std::is_same<decltype(std::ilogb((unsigned short)0)), int>::value), "");
897 static_assert((std::is_same<decltype(std::ilogb((int)0)), int>::value), "");
898 static_assert((std::is_same<decltype(std::ilogb((unsigned int)0)), int>::value), "");
899 static_assert((std::is_same<decltype(std::ilogb((long)0)), int>::value), "");
900 static_assert((std::is_same<decltype(std::ilogb((unsigned long)0)), int>::value), "");
901 static_assert((std::is_same<decltype(std::ilogb((long long)0)), int>::value), "");
902 static_assert((std::is_same<decltype(std::ilogb((unsigned long long)0)), int>::value), "");
903 static_assert((std::is_same<decltype(std::ilogb((double)0)), int>::value), "");
904 static_assert((std::is_same<decltype(std::ilogb((long double)0)), int>::value), "");
905 static_assert((std::is_same<decltype(std::ilogbf(0)), int>::value), "");
906 static_assert((std::is_same<decltype(std::ilogbl(0)), int>::value), "");
907 assert(std::ilogb(1) == 0);
910 void test_lgamma()
912 static_assert((std::is_same<decltype(std::lgamma((float)0)), float>::value), "");
913 static_assert((std::is_same<decltype(std::lgamma((bool)0)), double>::value), "");
914 static_assert((std::is_same<decltype(std::lgamma((unsigned short)0)), double>::value), "");
915 static_assert((std::is_same<decltype(std::lgamma((int)0)), double>::value), "");
916 static_assert((std::is_same<decltype(std::lgamma((unsigned int)0)), double>::value), "");
917 static_assert((std::is_same<decltype(std::lgamma((long)0)), double>::value), "");
918 static_assert((std::is_same<decltype(std::lgamma((unsigned long)0)), double>::value), "");
919 static_assert((std::is_same<decltype(std::lgamma((long long)0)), double>::value), "");
920 static_assert((std::is_same<decltype(std::lgamma((unsigned long long)0)), double>::value), "");
921 static_assert((std::is_same<decltype(std::lgamma((double)0)), double>::value), "");
922 static_assert((std::is_same<decltype(std::lgamma((long double)0)), long double>::value), "");
923 static_assert((std::is_same<decltype(std::lgammaf(0)), float>::value), "");
924 static_assert((std::is_same<decltype(std::lgammal(0)), long double>::value), "");
925 assert(std::lgamma(1) == 0);
928 void test_llrint()
930 static_assert((std::is_same<decltype(std::llrint((float)0)), long long>::value), "");
931 static_assert((std::is_same<decltype(std::llrint((bool)0)), long long>::value), "");
932 static_assert((std::is_same<decltype(std::llrint((unsigned short)0)), long long>::value), "");
933 static_assert((std::is_same<decltype(std::llrint((int)0)), long long>::value), "");
934 static_assert((std::is_same<decltype(std::llrint((unsigned int)0)), long long>::value), "");
935 static_assert((std::is_same<decltype(std::llrint((long)0)), long long>::value), "");
936 static_assert((std::is_same<decltype(std::llrint((unsigned long)0)), long long>::value), "");
937 static_assert((std::is_same<decltype(std::llrint((long long)0)), long long>::value), "");
938 static_assert((std::is_same<decltype(std::llrint((unsigned long long)0)), long long>::value), "");
939 static_assert((std::is_same<decltype(std::llrint((double)0)), long long>::value), "");
940 static_assert((std::is_same<decltype(std::llrint((long double)0)), long long>::value), "");
941 static_assert((std::is_same<decltype(std::llrintf(0)), long long>::value), "");
942 static_assert((std::is_same<decltype(std::llrintl(0)), long long>::value), "");
943 assert(std::llrint(1) == 1LL);
946 void test_llround()
948 static_assert((std::is_same<decltype(std::llround((float)0)), long long>::value), "");
949 static_assert((std::is_same<decltype(std::llround((bool)0)), long long>::value), "");
950 static_assert((std::is_same<decltype(std::llround((unsigned short)0)), long long>::value), "");
951 static_assert((std::is_same<decltype(std::llround((int)0)), long long>::value), "");
952 static_assert((std::is_same<decltype(std::llround((unsigned int)0)), long long>::value), "");
953 static_assert((std::is_same<decltype(std::llround((long)0)), long long>::value), "");
954 static_assert((std::is_same<decltype(std::llround((unsigned long)0)), long long>::value), "");
955 static_assert((std::is_same<decltype(std::llround((long long)0)), long long>::value), "");
956 static_assert((std::is_same<decltype(std::llround((unsigned long long)0)), long long>::value), "");
957 static_assert((std::is_same<decltype(std::llround((double)0)), long long>::value), "");
958 static_assert((std::is_same<decltype(std::llround((long double)0)), long long>::value), "");
959 static_assert((std::is_same<decltype(std::llroundf(0)), long long>::value), "");
960 static_assert((std::is_same<decltype(std::llroundl(0)), long long>::value), "");
961 assert(std::llround(1) == 1LL);
964 void test_log1p()
966 static_assert((std::is_same<decltype(std::log1p((float)0)), float>::value), "");
967 static_assert((std::is_same<decltype(std::log1p((bool)0)), double>::value), "");
968 static_assert((std::is_same<decltype(std::log1p((unsigned short)0)), double>::value), "");
969 static_assert((std::is_same<decltype(std::log1p((int)0)), double>::value), "");
970 static_assert((std::is_same<decltype(std::log1p((unsigned int)0)), double>::value), "");
971 static_assert((std::is_same<decltype(std::log1p((long)0)), double>::value), "");
972 static_assert((std::is_same<decltype(std::log1p((unsigned long)0)), double>::value), "");
973 static_assert((std::is_same<decltype(std::log1p((long long)0)), double>::value), "");
974 static_assert((std::is_same<decltype(std::log1p((unsigned long long)0)), double>::value), "");
975 static_assert((std::is_same<decltype(std::log1p((double)0)), double>::value), "");
976 static_assert((std::is_same<decltype(std::log1p((long double)0)), long double>::value), "");
977 static_assert((std::is_same<decltype(std::log1pf(0)), float>::value), "");
978 static_assert((std::is_same<decltype(std::log1pl(0)), long double>::value), "");
979 assert(std::log1p(0) == 0);
982 void test_log2()
984 static_assert((std::is_same<decltype(std::log2((float)0)), float>::value), "");
985 static_assert((std::is_same<decltype(std::log2((bool)0)), double>::value), "");
986 static_assert((std::is_same<decltype(std::log2((unsigned short)0)), double>::value), "");
987 static_assert((std::is_same<decltype(std::log2((int)0)), double>::value), "");
988 static_assert((std::is_same<decltype(std::log2((unsigned int)0)), double>::value), "");
989 static_assert((std::is_same<decltype(std::log2((long)0)), double>::value), "");
990 static_assert((std::is_same<decltype(std::log2((unsigned long)0)), double>::value), "");
991 static_assert((std::is_same<decltype(std::log2((long long)0)), double>::value), "");
992 static_assert((std::is_same<decltype(std::log2((unsigned long long)0)), double>::value), "");
993 static_assert((std::is_same<decltype(std::log2((double)0)), double>::value), "");
994 static_assert((std::is_same<decltype(std::log2((long double)0)), long double>::value), "");
995 static_assert((std::is_same<decltype(std::log2f(0)), float>::value), "");
996 static_assert((std::is_same<decltype(std::log2l(0)), long double>::value), "");
997 assert(std::log2(1) == 0);
1000 void test_logb()
1002 static_assert((std::is_same<decltype(std::logb((float)0)), float>::value), "");
1003 static_assert((std::is_same<decltype(std::logb((bool)0)), double>::value), "");
1004 static_assert((std::is_same<decltype(std::logb((unsigned short)0)), double>::value), "");
1005 static_assert((std::is_same<decltype(std::logb((int)0)), double>::value), "");
1006 static_assert((std::is_same<decltype(std::logb((unsigned int)0)), double>::value), "");
1007 static_assert((std::is_same<decltype(std::logb((long)0)), double>::value), "");
1008 static_assert((std::is_same<decltype(std::logb((unsigned long)0)), double>::value), "");
1009 static_assert((std::is_same<decltype(std::logb((long long)0)), double>::value), "");
1010 static_assert((std::is_same<decltype(std::logb((unsigned long long)0)), double>::value), "");
1011 static_assert((std::is_same<decltype(std::logb((double)0)), double>::value), "");
1012 static_assert((std::is_same<decltype(std::logb((long double)0)), long double>::value), "");
1013 static_assert((std::is_same<decltype(std::logbf(0)), float>::value), "");
1014 static_assert((std::is_same<decltype(std::logbl(0)), long double>::value), "");
1015 assert(std::logb(1) == 0);
1018 void test_lrint()
1020 static_assert((std::is_same<decltype(std::lrint((float)0)), long>::value), "");
1021 static_assert((std::is_same<decltype(std::lrint((bool)0)), long>::value), "");
1022 static_assert((std::is_same<decltype(std::lrint((unsigned short)0)), long>::value), "");
1023 static_assert((std::is_same<decltype(std::lrint((int)0)), long>::value), "");
1024 static_assert((std::is_same<decltype(std::lrint((unsigned int)0)), long>::value), "");
1025 static_assert((std::is_same<decltype(std::lrint((long)0)), long>::value), "");
1026 static_assert((std::is_same<decltype(std::lrint((unsigned long)0)), long>::value), "");
1027 static_assert((std::is_same<decltype(std::lrint((long long)0)), long>::value), "");
1028 static_assert((std::is_same<decltype(std::lrint((unsigned long long)0)), long>::value), "");
1029 static_assert((std::is_same<decltype(std::lrint((double)0)), long>::value), "");
1030 static_assert((std::is_same<decltype(std::lrint((long double)0)), long>::value), "");
1031 static_assert((std::is_same<decltype(std::lrintf(0)), long>::value), "");
1032 static_assert((std::is_same<decltype(std::lrintl(0)), long>::value), "");
1033 assert(std::lrint(1) == 1L);
1036 void test_lround()
1038 static_assert((std::is_same<decltype(std::lround((float)0)), long>::value), "");
1039 static_assert((std::is_same<decltype(std::lround((bool)0)), long>::value), "");
1040 static_assert((std::is_same<decltype(std::lround((unsigned short)0)), long>::value), "");
1041 static_assert((std::is_same<decltype(std::lround((int)0)), long>::value), "");
1042 static_assert((std::is_same<decltype(std::lround((unsigned int)0)), long>::value), "");
1043 static_assert((std::is_same<decltype(std::lround((long)0)), long>::value), "");
1044 static_assert((std::is_same<decltype(std::lround((unsigned long)0)), long>::value), "");
1045 static_assert((std::is_same<decltype(std::lround((long long)0)), long>::value), "");
1046 static_assert((std::is_same<decltype(std::lround((unsigned long long)0)), long>::value), "");
1047 static_assert((std::is_same<decltype(std::lround((double)0)), long>::value), "");
1048 static_assert((std::is_same<decltype(std::lround((long double)0)), long>::value), "");
1049 static_assert((std::is_same<decltype(std::lroundf(0)), long>::value), "");
1050 static_assert((std::is_same<decltype(std::lroundl(0)), long>::value), "");
1051 assert(std::lround(1) == 1L);
1054 void test_nan()
1056 static_assert((std::is_same<decltype(std::nan("")), double>::value), "");
1057 static_assert((std::is_same<decltype(std::nanf("")), float>::value), "");
1058 static_assert((std::is_same<decltype(std::nanl("")), long double>::value), "");
1061 void test_nearbyint()
1063 static_assert((std::is_same<decltype(std::nearbyint((float)0)), float>::value), "");
1064 static_assert((std::is_same<decltype(std::nearbyint((bool)0)), double>::value), "");
1065 static_assert((std::is_same<decltype(std::nearbyint((unsigned short)0)), double>::value), "");
1066 static_assert((std::is_same<decltype(std::nearbyint((int)0)), double>::value), "");
1067 static_assert((std::is_same<decltype(std::nearbyint((unsigned int)0)), double>::value), "");
1068 static_assert((std::is_same<decltype(std::nearbyint((long)0)), double>::value), "");
1069 static_assert((std::is_same<decltype(std::nearbyint((unsigned long)0)), double>::value), "");
1070 static_assert((std::is_same<decltype(std::nearbyint((long long)0)), double>::value), "");
1071 static_assert((std::is_same<decltype(std::nearbyint((unsigned long long)0)), double>::value), "");
1072 static_assert((std::is_same<decltype(std::nearbyint((double)0)), double>::value), "");
1073 static_assert((std::is_same<decltype(std::nearbyint((long double)0)), long double>::value), "");
1074 static_assert((std::is_same<decltype(std::nearbyintf(0)), float>::value), "");
1075 static_assert((std::is_same<decltype(std::nearbyintl(0)), long double>::value), "");
1076 assert(std::nearbyint(1) == 1);
1079 void test_nextafter()
1081 static_assert((std::is_same<decltype(std::nextafter((float)0, (float)0)), float>::value), "");
1082 static_assert((std::is_same<decltype(std::nextafter((bool)0, (float)0)), double>::value), "");
1083 static_assert((std::is_same<decltype(std::nextafter((unsigned short)0, (double)0)), double>::value), "");
1084 static_assert((std::is_same<decltype(std::nextafter((int)0, (long double)0)), long double>::value), "");
1085 static_assert((std::is_same<decltype(std::nextafter((float)0, (unsigned int)0)), double>::value), "");
1086 static_assert((std::is_same<decltype(std::nextafter((double)0, (long)0)), double>::value), "");
1087 static_assert((std::is_same<decltype(std::nextafter((long double)0, (unsigned long)0)), long double>::value), "");
1088 static_assert((std::is_same<decltype(std::nextafter((int)0, (long long)0)), double>::value), "");
1089 static_assert((std::is_same<decltype(std::nextafter((int)0, (unsigned long long)0)), double>::value), "");
1090 static_assert((std::is_same<decltype(std::nextafter((double)0, (double)0)), double>::value), "");
1091 static_assert((std::is_same<decltype(std::nextafter((long double)0, (long double)0)), long double>::value), "");
1092 static_assert((std::is_same<decltype(std::nextafter((float)0, (double)0)), double>::value), "");
1093 static_assert((std::is_same<decltype(std::nextafter((float)0, (long double)0)), long double>::value), "");
1094 static_assert((std::is_same<decltype(std::nextafter((double)0, (long double)0)), long double>::value), "");
1095 static_assert((std::is_same<decltype(std::nextafterf(0,0)), float>::value), "");
1096 static_assert((std::is_same<decltype(std::nextafterl(0,0)), long double>::value), "");
1097 static_assert((std::is_same<decltype(std::nextafter((int)0, (int)0)), double>::value), "");
1098 assert(std::nextafter(0,1) == hexfloat<double>(0x1, 0, -1074));
1101 void test_nexttoward()
1103 static_assert((std::is_same<decltype(std::nexttoward((float)0, (long double)0)), float>::value), "");
1104 static_assert((std::is_same<decltype(std::nexttoward((bool)0, (long double)0)), double>::value), "");
1105 static_assert((std::is_same<decltype(std::nexttoward((unsigned short)0, (long double)0)), double>::value), "");
1106 static_assert((std::is_same<decltype(std::nexttoward((int)0, (long double)0)), double>::value), "");
1107 static_assert((std::is_same<decltype(std::nexttoward((unsigned int)0, (long double)0)), double>::value), "");
1108 static_assert((std::is_same<decltype(std::nexttoward((long)0, (long double)0)), double>::value), "");
1109 static_assert((std::is_same<decltype(std::nexttoward((unsigned long)0, (long double)0)), double>::value), "");
1110 static_assert((std::is_same<decltype(std::nexttoward((long long)0, (long double)0)), double>::value), "");
1111 static_assert((std::is_same<decltype(std::nexttoward((unsigned long long)0, (long double)0)), double>::value), "");
1112 static_assert((std::is_same<decltype(std::nexttoward((double)0, (long double)0)), double>::value), "");
1113 static_assert((std::is_same<decltype(std::nexttoward((long double)0, (long double)0)), long double>::value), "");
1114 static_assert((std::is_same<decltype(std::nexttowardf(0, (long double)0)), float>::value), "");
1115 static_assert((std::is_same<decltype(std::nexttowardl(0, (long double)0)), long double>::value), "");
1116 assert(std::nexttoward(0, 1) == hexfloat<double>(0x1, 0, -1074));
1119 void test_remainder()
1121 static_assert((std::is_same<decltype(std::remainder((float)0, (float)0)), float>::value), "");
1122 static_assert((std::is_same<decltype(std::remainder((bool)0, (float)0)), double>::value), "");
1123 static_assert((std::is_same<decltype(std::remainder((unsigned short)0, (double)0)), double>::value), "");
1124 static_assert((std::is_same<decltype(std::remainder((int)0, (long double)0)), long double>::value), "");
1125 static_assert((std::is_same<decltype(std::remainder((float)0, (unsigned int)0)), double>::value), "");
1126 static_assert((std::is_same<decltype(std::remainder((double)0, (long)0)), double>::value), "");
1127 static_assert((std::is_same<decltype(std::remainder((long double)0, (unsigned long)0)), long double>::value), "");
1128 static_assert((std::is_same<decltype(std::remainder((int)0, (long long)0)), double>::value), "");
1129 static_assert((std::is_same<decltype(std::remainder((int)0, (unsigned long long)0)), double>::value), "");
1130 static_assert((std::is_same<decltype(std::remainder((double)0, (double)0)), double>::value), "");
1131 static_assert((std::is_same<decltype(std::remainder((long double)0, (long double)0)), long double>::value), "");
1132 static_assert((std::is_same<decltype(std::remainder((float)0, (double)0)), double>::value), "");
1133 static_assert((std::is_same<decltype(std::remainder((float)0, (long double)0)), long double>::value), "");
1134 static_assert((std::is_same<decltype(std::remainder((double)0, (long double)0)), long double>::value), "");
1135 static_assert((std::is_same<decltype(std::remainderf(0,0)), float>::value), "");
1136 static_assert((std::is_same<decltype(std::remainderl(0,0)), long double>::value), "");
1137 static_assert((std::is_same<decltype(std::remainder((int)0, (int)0)), double>::value), "");
1138 assert(std::remainder(0.5,1) == 0.5);
1141 void test_remquo()
1143 int ip;
1144 static_assert((std::is_same<decltype(std::remquo((float)0, (float)0, &ip)), float>::value), "");
1145 static_assert((std::is_same<decltype(std::remquo((bool)0, (float)0, &ip)), double>::value), "");
1146 static_assert((std::is_same<decltype(std::remquo((unsigned short)0, (double)0, &ip)), double>::value), "");
1147 static_assert((std::is_same<decltype(std::remquo((int)0, (long double)0, &ip)), long double>::value), "");
1148 static_assert((std::is_same<decltype(std::remquo((float)0, (unsigned int)0, &ip)), double>::value), "");
1149 static_assert((std::is_same<decltype(std::remquo((double)0, (long)0, &ip)), double>::value), "");
1150 static_assert((std::is_same<decltype(std::remquo((long double)0, (unsigned long)0, &ip)), long double>::value), "");
1151 static_assert((std::is_same<decltype(std::remquo((int)0, (long long)0, &ip)), double>::value), "");
1152 static_assert((std::is_same<decltype(std::remquo((int)0, (unsigned long long)0, &ip)), double>::value), "");
1153 static_assert((std::is_same<decltype(std::remquo((double)0, (double)0, &ip)), double>::value), "");
1154 static_assert((std::is_same<decltype(std::remquo((long double)0, (long double)0, &ip)), long double>::value), "");
1155 static_assert((std::is_same<decltype(std::remquo((float)0, (double)0, &ip)), double>::value), "");
1156 static_assert((std::is_same<decltype(std::remquo((float)0, (long double)0, &ip)), long double>::value), "");
1157 static_assert((std::is_same<decltype(std::remquo((double)0, (long double)0, &ip)), long double>::value), "");
1158 static_assert((std::is_same<decltype(std::remquof(0,0, &ip)), float>::value), "");
1159 static_assert((std::is_same<decltype(std::remquol(0,0, &ip)), long double>::value), "");
1160 static_assert((std::is_same<decltype(std::remquo((int)0, (int)0, &ip)), double>::value), "");
1161 assert(std::remquo(0.5,1, &ip) == 0.5);
1164 void test_rint()
1166 static_assert((std::is_same<decltype(std::rint((float)0)), float>::value), "");
1167 static_assert((std::is_same<decltype(std::rint((bool)0)), double>::value), "");
1168 static_assert((std::is_same<decltype(std::rint((unsigned short)0)), double>::value), "");
1169 static_assert((std::is_same<decltype(std::rint((int)0)), double>::value), "");
1170 static_assert((std::is_same<decltype(std::rint((unsigned int)0)), double>::value), "");
1171 static_assert((std::is_same<decltype(std::rint((long)0)), double>::value), "");
1172 static_assert((std::is_same<decltype(std::rint((unsigned long)0)), double>::value), "");
1173 static_assert((std::is_same<decltype(std::rint((long long)0)), double>::value), "");
1174 static_assert((std::is_same<decltype(std::rint((unsigned long long)0)), double>::value), "");
1175 static_assert((std::is_same<decltype(std::rint((double)0)), double>::value), "");
1176 static_assert((std::is_same<decltype(std::rint((long double)0)), long double>::value), "");
1177 static_assert((std::is_same<decltype(std::rintf(0)), float>::value), "");
1178 static_assert((std::is_same<decltype(std::rintl(0)), long double>::value), "");
1179 assert(std::rint(1) == 1);
1182 void test_round()
1184 static_assert((std::is_same<decltype(std::round((float)0)), float>::value), "");
1185 static_assert((std::is_same<decltype(std::round((bool)0)), double>::value), "");
1186 static_assert((std::is_same<decltype(std::round((unsigned short)0)), double>::value), "");
1187 static_assert((std::is_same<decltype(std::round((int)0)), double>::value), "");
1188 static_assert((std::is_same<decltype(std::round((unsigned int)0)), double>::value), "");
1189 static_assert((std::is_same<decltype(std::round((long)0)), double>::value), "");
1190 static_assert((std::is_same<decltype(std::round((unsigned long)0)), double>::value), "");
1191 static_assert((std::is_same<decltype(std::round((long long)0)), double>::value), "");
1192 static_assert((std::is_same<decltype(std::round((unsigned long long)0)), double>::value), "");
1193 static_assert((std::is_same<decltype(std::round((double)0)), double>::value), "");
1194 static_assert((std::is_same<decltype(std::round((long double)0)), long double>::value), "");
1195 static_assert((std::is_same<decltype(std::roundf(0)), float>::value), "");
1196 static_assert((std::is_same<decltype(std::roundl(0)), long double>::value), "");
1197 assert(std::round(1) == 1);
1200 void test_scalbln()
1202 static_assert((std::is_same<decltype(std::scalbln((float)0, (long)0)), float>::value), "");
1203 static_assert((std::is_same<decltype(std::scalbln((bool)0, (long)0)), double>::value), "");
1204 static_assert((std::is_same<decltype(std::scalbln((unsigned short)0, (long)0)), double>::value), "");
1205 static_assert((std::is_same<decltype(std::scalbln((int)0, (long)0)), double>::value), "");
1206 static_assert((std::is_same<decltype(std::scalbln((unsigned int)0, (long)0)), double>::value), "");
1207 static_assert((std::is_same<decltype(std::scalbln((long)0, (long)0)), double>::value), "");
1208 static_assert((std::is_same<decltype(std::scalbln((unsigned long)0, (long)0)), double>::value), "");
1209 static_assert((std::is_same<decltype(std::scalbln((long long)0, (long)0)), double>::value), "");
1210 static_assert((std::is_same<decltype(std::scalbln((unsigned long long)0, (long)0)), double>::value), "");
1211 static_assert((std::is_same<decltype(std::scalbln((double)0, (long)0)), double>::value), "");
1212 static_assert((std::is_same<decltype(std::scalbln((long double)0, (long)0)), long double>::value), "");
1213 static_assert((std::is_same<decltype(std::scalblnf(0, (long)0)), float>::value), "");
1214 static_assert((std::is_same<decltype(std::scalblnl(0, (long)0)), long double>::value), "");
1215 assert(std::scalbln(1, 1) == 2);
1218 void test_scalbn()
1220 static_assert((std::is_same<decltype(std::scalbn((float)0, (int)0)), float>::value), "");
1221 static_assert((std::is_same<decltype(std::scalbn((bool)0, (int)0)), double>::value), "");
1222 static_assert((std::is_same<decltype(std::scalbn((unsigned short)0, (int)0)), double>::value), "");
1223 static_assert((std::is_same<decltype(std::scalbn((int)0, (int)0)), double>::value), "");
1224 static_assert((std::is_same<decltype(std::scalbn((unsigned int)0, (int)0)), double>::value), "");
1225 static_assert((std::is_same<decltype(std::scalbn((long)0, (int)0)), double>::value), "");
1226 static_assert((std::is_same<decltype(std::scalbn((unsigned long)0, (int)0)), double>::value), "");
1227 static_assert((std::is_same<decltype(std::scalbn((long long)0, (int)0)), double>::value), "");
1228 static_assert((std::is_same<decltype(std::scalbn((unsigned long long)0, (int)0)), double>::value), "");
1229 static_assert((std::is_same<decltype(std::scalbn((double)0, (int)0)), double>::value), "");
1230 static_assert((std::is_same<decltype(std::scalbn((long double)0, (int)0)), long double>::value), "");
1231 static_assert((std::is_same<decltype(std::scalbnf(0, (int)0)), float>::value), "");
1232 static_assert((std::is_same<decltype(std::scalbnl(0, (int)0)), long double>::value), "");
1233 assert(std::scalbn(1, 1) == 2);
1236 void test_tgamma()
1238 static_assert((std::is_same<decltype(std::tgamma((float)0)), float>::value), "");
1239 static_assert((std::is_same<decltype(std::tgamma((bool)0)), double>::value), "");
1240 static_assert((std::is_same<decltype(std::tgamma((unsigned short)0)), double>::value), "");
1241 static_assert((std::is_same<decltype(std::tgamma((int)0)), double>::value), "");
1242 static_assert((std::is_same<decltype(std::tgamma((unsigned int)0)), double>::value), "");
1243 static_assert((std::is_same<decltype(std::tgamma((long)0)), double>::value), "");
1244 static_assert((std::is_same<decltype(std::tgamma((unsigned long)0)), double>::value), "");
1245 static_assert((std::is_same<decltype(std::tgamma((long long)0)), double>::value), "");
1246 static_assert((std::is_same<decltype(std::tgamma((unsigned long long)0)), double>::value), "");
1247 static_assert((std::is_same<decltype(std::tgamma((double)0)), double>::value), "");
1248 static_assert((std::is_same<decltype(std::tgamma((long double)0)), long double>::value), "");
1249 static_assert((std::is_same<decltype(std::tgammaf(0)), float>::value), "");
1250 static_assert((std::is_same<decltype(std::tgammal(0)), long double>::value), "");
1251 assert(std::tgamma(1) == 1);
1254 void test_trunc()
1256 static_assert((std::is_same<decltype(std::trunc((float)0)), float>::value), "");
1257 static_assert((std::is_same<decltype(std::trunc((bool)0)), double>::value), "");
1258 static_assert((std::is_same<decltype(std::trunc((unsigned short)0)), double>::value), "");
1259 static_assert((std::is_same<decltype(std::trunc((int)0)), double>::value), "");
1260 static_assert((std::is_same<decltype(std::trunc((unsigned int)0)), double>::value), "");
1261 static_assert((std::is_same<decltype(std::trunc((long)0)), double>::value), "");
1262 static_assert((std::is_same<decltype(std::trunc((unsigned long)0)), double>::value), "");
1263 static_assert((std::is_same<decltype(std::trunc((long long)0)), double>::value), "");
1264 static_assert((std::is_same<decltype(std::trunc((unsigned long long)0)), double>::value), "");
1265 static_assert((std::is_same<decltype(std::trunc((double)0)), double>::value), "");
1266 static_assert((std::is_same<decltype(std::trunc((long double)0)), long double>::value), "");
1267 static_assert((std::is_same<decltype(std::truncf(0)), float>::value), "");
1268 static_assert((std::is_same<decltype(std::truncl(0)), long double>::value), "");
1269 assert(std::trunc(1) == 1);
1272 int main()
1274 test_abs();
1275 test_acos();
1276 test_asin();
1277 test_atan();
1278 test_atan2();
1279 test_ceil();
1280 test_cos();
1281 test_cosh();
1282 test_exp();
1283 test_fabs();
1284 test_floor();
1285 test_fmod();
1286 test_frexp();
1287 test_ldexp();
1288 test_log();
1289 test_log10();
1290 test_modf();
1291 test_pow();
1292 test_sin();
1293 test_sinh();
1294 test_sqrt();
1295 test_tan();
1296 test_tanh();
1297 test_signbit();
1298 test_fpclassify();
1299 test_isfinite();
1300 test_isnormal();
1301 test_isgreater();
1302 test_isgreaterequal();
1303 test_isless();
1304 test_islessequal();
1305 test_islessgreater();
1306 test_isunordered();
1307 test_acosh();
1308 test_asinh();
1309 test_atanh();
1310 test_cbrt();
1311 test_copysign();
1312 test_erf();
1313 test_erfc();
1314 test_exp2();
1315 test_expm1();
1316 test_fdim();
1317 test_fma();
1318 test_fmax();
1319 test_fmin();
1320 test_hypot();
1321 test_ilogb();
1322 test_lgamma();
1323 test_llrint();
1324 test_llround();
1325 test_log1p();
1326 test_log2();
1327 test_logb();
1328 test_lrint();
1329 test_lround();
1330 test_nan();
1331 test_nearbyint();
1332 test_nextafter();
1333 test_nexttoward();
1334 test_remainder();
1335 test_remquo();
1336 test_rint();
1337 test_round();
1338 test_scalbln();
1339 test_scalbn();
1340 test_tgamma();
1341 test_trunc();