1*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===//
2*0a6a1f1dSLionel Sambuc //
3*0a6a1f1dSLionel Sambuc // The LLVM Compiler Infrastructure
4*0a6a1f1dSLionel Sambuc //
5*0a6a1f1dSLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
6*0a6a1f1dSLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
7*0a6a1f1dSLionel Sambuc //
8*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===//
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel Sambuc // <cmath>
11*0a6a1f1dSLionel Sambuc
12*0a6a1f1dSLionel Sambuc // NOTE: isinf and isnan are tested separately because they are expected to fail
13*0a6a1f1dSLionel Sambuc // on linux. We don't want their expected failure to hide other failures in this file.
14*0a6a1f1dSLionel Sambuc
15*0a6a1f1dSLionel Sambuc #include <cmath>
16*0a6a1f1dSLionel Sambuc #include <type_traits>
17*0a6a1f1dSLionel Sambuc #include <cassert>
18*0a6a1f1dSLionel Sambuc
19*0a6a1f1dSLionel Sambuc #include "hexfloat.h"
20*0a6a1f1dSLionel Sambuc
21*0a6a1f1dSLionel Sambuc // convertible to int/float/double/etc
22*0a6a1f1dSLionel Sambuc template <class T, int N=0>
23*0a6a1f1dSLionel Sambuc struct Value {
operator TValue24*0a6a1f1dSLionel Sambuc operator T () { return T(N); }
25*0a6a1f1dSLionel Sambuc };
26*0a6a1f1dSLionel Sambuc
27*0a6a1f1dSLionel Sambuc // See PR21083
28*0a6a1f1dSLionel Sambuc // Ambiguous is a user-defined type that defines its own overloads of cmath
29*0a6a1f1dSLionel Sambuc // functions. When the std overloads are candidates too (by using or adl),
30*0a6a1f1dSLionel Sambuc // they should not interfere.
31*0a6a1f1dSLionel Sambuc struct Ambiguous : std::true_type { // ADL
operator floatAmbiguous32*0a6a1f1dSLionel Sambuc operator float () { return 0.f; }
operator doubleAmbiguous33*0a6a1f1dSLionel Sambuc operator double () { return 0.; }
34*0a6a1f1dSLionel Sambuc };
abs(Ambiguous)35*0a6a1f1dSLionel Sambuc Ambiguous abs(Ambiguous){ return Ambiguous(); }
acos(Ambiguous)36*0a6a1f1dSLionel Sambuc Ambiguous acos(Ambiguous){ return Ambiguous(); }
asin(Ambiguous)37*0a6a1f1dSLionel Sambuc Ambiguous asin(Ambiguous){ return Ambiguous(); }
atan(Ambiguous)38*0a6a1f1dSLionel Sambuc Ambiguous atan(Ambiguous){ return Ambiguous(); }
atan2(Ambiguous,Ambiguous)39*0a6a1f1dSLionel Sambuc Ambiguous atan2(Ambiguous, Ambiguous){ return Ambiguous(); }
ceil(Ambiguous)40*0a6a1f1dSLionel Sambuc Ambiguous ceil(Ambiguous){ return Ambiguous(); }
cos(Ambiguous)41*0a6a1f1dSLionel Sambuc Ambiguous cos(Ambiguous){ return Ambiguous(); }
cosh(Ambiguous)42*0a6a1f1dSLionel Sambuc Ambiguous cosh(Ambiguous){ return Ambiguous(); }
exp(Ambiguous)43*0a6a1f1dSLionel Sambuc Ambiguous exp(Ambiguous){ return Ambiguous(); }
fabs(Ambiguous)44*0a6a1f1dSLionel Sambuc Ambiguous fabs(Ambiguous){ return Ambiguous(); }
floor(Ambiguous)45*0a6a1f1dSLionel Sambuc Ambiguous floor(Ambiguous){ return Ambiguous(); }
fmod(Ambiguous,Ambiguous)46*0a6a1f1dSLionel Sambuc Ambiguous fmod(Ambiguous, Ambiguous){ return Ambiguous(); }
frexp(Ambiguous,int *)47*0a6a1f1dSLionel Sambuc Ambiguous frexp(Ambiguous, int*){ return Ambiguous(); }
ldexp(Ambiguous,int)48*0a6a1f1dSLionel Sambuc Ambiguous ldexp(Ambiguous, int){ return Ambiguous(); }
log(Ambiguous)49*0a6a1f1dSLionel Sambuc Ambiguous log(Ambiguous){ return Ambiguous(); }
log10(Ambiguous)50*0a6a1f1dSLionel Sambuc Ambiguous log10(Ambiguous){ return Ambiguous(); }
modf(Ambiguous,Ambiguous *)51*0a6a1f1dSLionel Sambuc Ambiguous modf(Ambiguous, Ambiguous*){ return Ambiguous(); }
pow(Ambiguous,Ambiguous)52*0a6a1f1dSLionel Sambuc Ambiguous pow(Ambiguous, Ambiguous){ return Ambiguous(); }
sin(Ambiguous)53*0a6a1f1dSLionel Sambuc Ambiguous sin(Ambiguous){ return Ambiguous(); }
sinh(Ambiguous)54*0a6a1f1dSLionel Sambuc Ambiguous sinh(Ambiguous){ return Ambiguous(); }
sqrt(Ambiguous)55*0a6a1f1dSLionel Sambuc Ambiguous sqrt(Ambiguous){ return Ambiguous(); }
tan(Ambiguous)56*0a6a1f1dSLionel Sambuc Ambiguous tan(Ambiguous){ return Ambiguous(); }
tanh(Ambiguous)57*0a6a1f1dSLionel Sambuc Ambiguous tanh(Ambiguous){ return Ambiguous(); }
signbit(Ambiguous)58*0a6a1f1dSLionel Sambuc Ambiguous signbit(Ambiguous){ return Ambiguous(); }
fpclassify(Ambiguous)59*0a6a1f1dSLionel Sambuc Ambiguous fpclassify(Ambiguous){ return Ambiguous(); }
isfinite(Ambiguous)60*0a6a1f1dSLionel Sambuc Ambiguous isfinite(Ambiguous){ return Ambiguous(); }
isnormal(Ambiguous)61*0a6a1f1dSLionel Sambuc Ambiguous isnormal(Ambiguous){ return Ambiguous(); }
isgreater(Ambiguous,Ambiguous)62*0a6a1f1dSLionel Sambuc Ambiguous isgreater(Ambiguous, Ambiguous){ return Ambiguous(); }
isgreaterequal(Ambiguous,Ambiguous)63*0a6a1f1dSLionel Sambuc Ambiguous isgreaterequal(Ambiguous, Ambiguous){ return Ambiguous(); }
isless(Ambiguous,Ambiguous)64*0a6a1f1dSLionel Sambuc Ambiguous isless(Ambiguous, Ambiguous){ return Ambiguous(); }
islessequal(Ambiguous,Ambiguous)65*0a6a1f1dSLionel Sambuc Ambiguous islessequal(Ambiguous, Ambiguous){ return Ambiguous(); }
islessgreater(Ambiguous,Ambiguous)66*0a6a1f1dSLionel Sambuc Ambiguous islessgreater(Ambiguous, Ambiguous){ return Ambiguous(); }
isunordered(Ambiguous,Ambiguous)67*0a6a1f1dSLionel Sambuc Ambiguous isunordered(Ambiguous, Ambiguous){ return Ambiguous(); }
acosh(Ambiguous)68*0a6a1f1dSLionel Sambuc Ambiguous acosh(Ambiguous){ return Ambiguous(); }
asinh(Ambiguous)69*0a6a1f1dSLionel Sambuc Ambiguous asinh(Ambiguous){ return Ambiguous(); }
atanh(Ambiguous)70*0a6a1f1dSLionel Sambuc Ambiguous atanh(Ambiguous){ return Ambiguous(); }
cbrt(Ambiguous)71*0a6a1f1dSLionel Sambuc Ambiguous cbrt(Ambiguous){ return Ambiguous(); }
copysign(Ambiguous,Ambiguous)72*0a6a1f1dSLionel Sambuc Ambiguous copysign(Ambiguous, Ambiguous){ return Ambiguous(); }
erf(Ambiguous)73*0a6a1f1dSLionel Sambuc Ambiguous erf(Ambiguous){ return Ambiguous(); }
erfc(Ambiguous)74*0a6a1f1dSLionel Sambuc Ambiguous erfc(Ambiguous){ return Ambiguous(); }
exp2(Ambiguous)75*0a6a1f1dSLionel Sambuc Ambiguous exp2(Ambiguous){ return Ambiguous(); }
expm1(Ambiguous)76*0a6a1f1dSLionel Sambuc Ambiguous expm1(Ambiguous){ return Ambiguous(); }
fdim(Ambiguous,Ambiguous)77*0a6a1f1dSLionel Sambuc Ambiguous fdim(Ambiguous, Ambiguous){ return Ambiguous(); }
fma(Ambiguous,Ambiguous,Ambiguous)78*0a6a1f1dSLionel Sambuc Ambiguous fma(Ambiguous, Ambiguous, Ambiguous){ return Ambiguous(); }
fmax(Ambiguous,Ambiguous)79*0a6a1f1dSLionel Sambuc Ambiguous fmax(Ambiguous, Ambiguous){ return Ambiguous(); }
fmin(Ambiguous,Ambiguous)80*0a6a1f1dSLionel Sambuc Ambiguous fmin(Ambiguous, Ambiguous){ return Ambiguous(); }
hypot(Ambiguous,Ambiguous)81*0a6a1f1dSLionel Sambuc Ambiguous hypot(Ambiguous, Ambiguous){ return Ambiguous(); }
ilogb(Ambiguous)82*0a6a1f1dSLionel Sambuc Ambiguous ilogb(Ambiguous){ return Ambiguous(); }
lgamma(Ambiguous)83*0a6a1f1dSLionel Sambuc Ambiguous lgamma(Ambiguous){ return Ambiguous(); }
llrint(Ambiguous)84*0a6a1f1dSLionel Sambuc Ambiguous llrint(Ambiguous){ return Ambiguous(); }
llround(Ambiguous)85*0a6a1f1dSLionel Sambuc Ambiguous llround(Ambiguous){ return Ambiguous(); }
log1p(Ambiguous)86*0a6a1f1dSLionel Sambuc Ambiguous log1p(Ambiguous){ return Ambiguous(); }
log2(Ambiguous)87*0a6a1f1dSLionel Sambuc Ambiguous log2(Ambiguous){ return Ambiguous(); }
logb(Ambiguous)88*0a6a1f1dSLionel Sambuc Ambiguous logb(Ambiguous){ return Ambiguous(); }
lrint(Ambiguous)89*0a6a1f1dSLionel Sambuc Ambiguous lrint(Ambiguous){ return Ambiguous(); }
lround(Ambiguous)90*0a6a1f1dSLionel Sambuc Ambiguous lround(Ambiguous){ return Ambiguous(); }
nearbyint(Ambiguous)91*0a6a1f1dSLionel Sambuc Ambiguous nearbyint(Ambiguous){ return Ambiguous(); }
nextafter(Ambiguous,Ambiguous)92*0a6a1f1dSLionel Sambuc Ambiguous nextafter(Ambiguous, Ambiguous){ return Ambiguous(); }
nexttoward(Ambiguous,Ambiguous)93*0a6a1f1dSLionel Sambuc Ambiguous nexttoward(Ambiguous, Ambiguous){ return Ambiguous(); }
remainder(Ambiguous,Ambiguous)94*0a6a1f1dSLionel Sambuc Ambiguous remainder(Ambiguous, Ambiguous){ return Ambiguous(); }
remquo(Ambiguous,Ambiguous,int *)95*0a6a1f1dSLionel Sambuc Ambiguous remquo(Ambiguous, Ambiguous, int*){ return Ambiguous(); }
rint(Ambiguous)96*0a6a1f1dSLionel Sambuc Ambiguous rint(Ambiguous){ return Ambiguous(); }
round(Ambiguous)97*0a6a1f1dSLionel Sambuc Ambiguous round(Ambiguous){ return Ambiguous(); }
scalbln(Ambiguous,Ambiguous)98*0a6a1f1dSLionel Sambuc Ambiguous scalbln(Ambiguous, Ambiguous){ return Ambiguous(); }
scalbn(Ambiguous,Ambiguous)99*0a6a1f1dSLionel Sambuc Ambiguous scalbn(Ambiguous, Ambiguous){ return Ambiguous(); }
tgamma(Ambiguous)100*0a6a1f1dSLionel Sambuc Ambiguous tgamma(Ambiguous){ return Ambiguous(); }
trunc(Ambiguous)101*0a6a1f1dSLionel Sambuc Ambiguous trunc(Ambiguous){ return Ambiguous(); }
102*0a6a1f1dSLionel Sambuc
test_abs()103*0a6a1f1dSLionel Sambuc void test_abs()
104*0a6a1f1dSLionel Sambuc {
105*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::abs((float)0)), float>::value), "");
106*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::abs((double)0)), double>::value), "");
107*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::abs((long double)0)), long double>::value), "");
108*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(abs(Ambiguous())), Ambiguous>::value), "");
109*0a6a1f1dSLionel Sambuc assert(std::abs(-1.) == 1);
110*0a6a1f1dSLionel Sambuc }
111*0a6a1f1dSLionel Sambuc
test_acos()112*0a6a1f1dSLionel Sambuc void test_acos()
113*0a6a1f1dSLionel Sambuc {
114*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((float)0)), float>::value), "");
115*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((bool)0)), double>::value), "");
116*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((unsigned short)0)), double>::value), "");
117*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((int)0)), double>::value), "");
118*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((unsigned int)0)), double>::value), "");
119*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((long)0)), double>::value), "");
120*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((unsigned long)0)), double>::value), "");
121*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((long long)0)), double>::value), "");
122*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((unsigned long long)0)), double>::value), "");
123*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((double)0)), double>::value), "");
124*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acos((long double)0)), long double>::value), "");
125*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosf(0)), float>::value), "");
126*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosl(0)), long double>::value), "");
127*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(acos(Ambiguous())), Ambiguous>::value), "");
128*0a6a1f1dSLionel Sambuc assert(std::acos(1) == 0);
129*0a6a1f1dSLionel Sambuc }
130*0a6a1f1dSLionel Sambuc
test_asin()131*0a6a1f1dSLionel Sambuc void test_asin()
132*0a6a1f1dSLionel Sambuc {
133*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((float)0)), float>::value), "");
134*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((bool)0)), double>::value), "");
135*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((unsigned short)0)), double>::value), "");
136*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((int)0)), double>::value), "");
137*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((unsigned int)0)), double>::value), "");
138*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((long)0)), double>::value), "");
139*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((unsigned long)0)), double>::value), "");
140*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((long long)0)), double>::value), "");
141*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((unsigned long long)0)), double>::value), "");
142*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((double)0)), double>::value), "");
143*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asin((long double)0)), long double>::value), "");
144*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinf(0)), float>::value), "");
145*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinl(0)), long double>::value), "");
146*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(asin(Ambiguous())), Ambiguous>::value), "");
147*0a6a1f1dSLionel Sambuc assert(std::asin(0) == 0);
148*0a6a1f1dSLionel Sambuc }
149*0a6a1f1dSLionel Sambuc
test_atan()150*0a6a1f1dSLionel Sambuc void test_atan()
151*0a6a1f1dSLionel Sambuc {
152*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((float)0)), float>::value), "");
153*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((bool)0)), double>::value), "");
154*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((unsigned short)0)), double>::value), "");
155*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((int)0)), double>::value), "");
156*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((unsigned int)0)), double>::value), "");
157*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((long)0)), double>::value), "");
158*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((unsigned long)0)), double>::value), "");
159*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((long long)0)), double>::value), "");
160*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((unsigned long long)0)), double>::value), "");
161*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((double)0)), double>::value), "");
162*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan((long double)0)), long double>::value), "");
163*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanf(0)), float>::value), "");
164*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanl(0)), long double>::value), "");
165*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(atan(Ambiguous())), Ambiguous>::value), "");
166*0a6a1f1dSLionel Sambuc assert(std::atan(0) == 0);
167*0a6a1f1dSLionel Sambuc }
168*0a6a1f1dSLionel Sambuc
test_atan2()169*0a6a1f1dSLionel Sambuc void test_atan2()
170*0a6a1f1dSLionel Sambuc {
171*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((float)0, (float)0)), float>::value), "");
172*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((bool)0, (float)0)), double>::value), "");
173*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((unsigned short)0, (double)0)), double>::value), "");
174*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((int)0, (long double)0)), long double>::value), "");
175*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((float)0, (unsigned int)0)), double>::value), "");
176*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((double)0, (long)0)), double>::value), "");
177*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((long double)0, (unsigned long)0)), long double>::value), "");
178*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((int)0, (long long)0)), double>::value), "");
179*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((int)0, (unsigned long long)0)), double>::value), "");
180*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((double)0, (double)0)), double>::value), "");
181*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((long double)0, (long double)0)), long double>::value), "");
182*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((float)0, (double)0)), double>::value), "");
183*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((float)0, (long double)0)), long double>::value), "");
184*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((double)0, (long double)0)), long double>::value), "");
185*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2f(0,0)), float>::value), "");
186*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2l(0,0)), long double>::value), "");
187*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atan2((int)0, (int)0)), double>::value), "");
188*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(atan2(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
189*0a6a1f1dSLionel Sambuc assert(std::atan2(0,1) == 0);
190*0a6a1f1dSLionel Sambuc }
191*0a6a1f1dSLionel Sambuc
test_ceil()192*0a6a1f1dSLionel Sambuc void test_ceil()
193*0a6a1f1dSLionel Sambuc {
194*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((float)0)), float>::value), "");
195*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((bool)0)), double>::value), "");
196*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((unsigned short)0)), double>::value), "");
197*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((int)0)), double>::value), "");
198*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((unsigned int)0)), double>::value), "");
199*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((long)0)), double>::value), "");
200*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((unsigned long)0)), double>::value), "");
201*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((long long)0)), double>::value), "");
202*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((unsigned long long)0)), double>::value), "");
203*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((double)0)), double>::value), "");
204*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceil((long double)0)), long double>::value), "");
205*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceilf(0)), float>::value), "");
206*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ceill(0)), long double>::value), "");
207*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(ceil(Ambiguous())), Ambiguous>::value), "");
208*0a6a1f1dSLionel Sambuc assert(std::ceil(0) == 0);
209*0a6a1f1dSLionel Sambuc }
210*0a6a1f1dSLionel Sambuc
test_cos()211*0a6a1f1dSLionel Sambuc void test_cos()
212*0a6a1f1dSLionel Sambuc {
213*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((float)0)), float>::value), "");
214*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((bool)0)), double>::value), "");
215*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((unsigned short)0)), double>::value), "");
216*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((int)0)), double>::value), "");
217*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((unsigned int)0)), double>::value), "");
218*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((long)0)), double>::value), "");
219*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((unsigned long)0)), double>::value), "");
220*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((long long)0)), double>::value), "");
221*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((unsigned long long)0)), double>::value), "");
222*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((double)0)), double>::value), "");
223*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cos((long double)0)), long double>::value), "");
224*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosf(0)), float>::value), "");
225*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosl(0)), long double>::value), "");
226*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(cos(Ambiguous())), Ambiguous>::value), "");
227*0a6a1f1dSLionel Sambuc assert(std::cos(0) == 1);
228*0a6a1f1dSLionel Sambuc }
229*0a6a1f1dSLionel Sambuc
test_cosh()230*0a6a1f1dSLionel Sambuc void test_cosh()
231*0a6a1f1dSLionel Sambuc {
232*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((float)0)), float>::value), "");
233*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((bool)0)), double>::value), "");
234*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((unsigned short)0)), double>::value), "");
235*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((int)0)), double>::value), "");
236*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((unsigned int)0)), double>::value), "");
237*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((long)0)), double>::value), "");
238*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((unsigned long)0)), double>::value), "");
239*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((long long)0)), double>::value), "");
240*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((unsigned long long)0)), double>::value), "");
241*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((double)0)), double>::value), "");
242*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cosh((long double)0)), long double>::value), "");
243*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::coshf(0)), float>::value), "");
244*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::coshl(0)), long double>::value), "");
245*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(cosh(Ambiguous())), Ambiguous>::value), "");
246*0a6a1f1dSLionel Sambuc assert(std::cosh(0) == 1);
247*0a6a1f1dSLionel Sambuc }
248*0a6a1f1dSLionel Sambuc
test_exp()249*0a6a1f1dSLionel Sambuc void test_exp()
250*0a6a1f1dSLionel Sambuc {
251*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((float)0)), float>::value), "");
252*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((bool)0)), double>::value), "");
253*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((unsigned short)0)), double>::value), "");
254*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((int)0)), double>::value), "");
255*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((unsigned int)0)), double>::value), "");
256*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((long)0)), double>::value), "");
257*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((unsigned long)0)), double>::value), "");
258*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((long long)0)), double>::value), "");
259*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((unsigned long long)0)), double>::value), "");
260*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((double)0)), double>::value), "");
261*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp((long double)0)), long double>::value), "");
262*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expf(0)), float>::value), "");
263*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expl(0)), long double>::value), "");
264*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(exp(Ambiguous())), Ambiguous>::value), "");
265*0a6a1f1dSLionel Sambuc assert(std::exp(0) == 1);
266*0a6a1f1dSLionel Sambuc }
267*0a6a1f1dSLionel Sambuc
test_fabs()268*0a6a1f1dSLionel Sambuc void test_fabs()
269*0a6a1f1dSLionel Sambuc {
270*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((float)0)), float>::value), "");
271*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((bool)0)), double>::value), "");
272*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((unsigned short)0)), double>::value), "");
273*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((int)0)), double>::value), "");
274*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((unsigned int)0)), double>::value), "");
275*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((long)0)), double>::value), "");
276*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((unsigned long)0)), double>::value), "");
277*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((long long)0)), double>::value), "");
278*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((unsigned long long)0)), double>::value), "");
279*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((double)0)), double>::value), "");
280*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabs((long double)0)), long double>::value), "");
281*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabsf(0.0f)), float>::value), "");
282*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fabsl(0.0L)), long double>::value), "");
283*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(fabs(Ambiguous())), Ambiguous>::value), "");
284*0a6a1f1dSLionel Sambuc assert(std::fabs(-1) == 1);
285*0a6a1f1dSLionel Sambuc }
286*0a6a1f1dSLionel Sambuc
test_floor()287*0a6a1f1dSLionel Sambuc void test_floor()
288*0a6a1f1dSLionel Sambuc {
289*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((float)0)), float>::value), "");
290*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((bool)0)), double>::value), "");
291*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((unsigned short)0)), double>::value), "");
292*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((int)0)), double>::value), "");
293*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((unsigned int)0)), double>::value), "");
294*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((long)0)), double>::value), "");
295*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((unsigned long)0)), double>::value), "");
296*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((long long)0)), double>::value), "");
297*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((unsigned long long)0)), double>::value), "");
298*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((double)0)), double>::value), "");
299*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floor((long double)0)), long double>::value), "");
300*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floorf(0)), float>::value), "");
301*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::floorl(0)), long double>::value), "");
302*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(floor(Ambiguous())), Ambiguous>::value), "");
303*0a6a1f1dSLionel Sambuc assert(std::floor(1) == 1);
304*0a6a1f1dSLionel Sambuc }
305*0a6a1f1dSLionel Sambuc
test_fmod()306*0a6a1f1dSLionel Sambuc void test_fmod()
307*0a6a1f1dSLionel Sambuc {
308*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((float)0, (float)0)), float>::value), "");
309*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((bool)0, (float)0)), double>::value), "");
310*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((unsigned short)0, (double)0)), double>::value), "");
311*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((int)0, (long double)0)), long double>::value), "");
312*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((float)0, (unsigned int)0)), double>::value), "");
313*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((double)0, (long)0)), double>::value), "");
314*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((long double)0, (unsigned long)0)), long double>::value), "");
315*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((int)0, (long long)0)), double>::value), "");
316*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((int)0, (unsigned long long)0)), double>::value), "");
317*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((double)0, (double)0)), double>::value), "");
318*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((long double)0, (long double)0)), long double>::value), "");
319*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((float)0, (double)0)), double>::value), "");
320*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((float)0, (long double)0)), long double>::value), "");
321*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((double)0, (long double)0)), long double>::value), "");
322*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmodf(0,0)), float>::value), "");
323*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmodl(0,0)), long double>::value), "");
324*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmod((int)0, (int)0)), double>::value), "");
325*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(fmod(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
326*0a6a1f1dSLionel Sambuc assert(std::fmod(1.5,1) == .5);
327*0a6a1f1dSLionel Sambuc }
328*0a6a1f1dSLionel Sambuc
test_frexp()329*0a6a1f1dSLionel Sambuc void test_frexp()
330*0a6a1f1dSLionel Sambuc {
331*0a6a1f1dSLionel Sambuc int ip;
332*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((float)0, &ip)), float>::value), "");
333*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((bool)0, &ip)), double>::value), "");
334*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((unsigned short)0, &ip)), double>::value), "");
335*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((int)0, &ip)), double>::value), "");
336*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((unsigned int)0, &ip)), double>::value), "");
337*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((long)0, &ip)), double>::value), "");
338*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((unsigned long)0, &ip)), double>::value), "");
339*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((long long)0, &ip)), double>::value), "");
340*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((unsigned long long)0, &ip)), double>::value), "");
341*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((double)0, &ip)), double>::value), "");
342*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexp((long double)0, &ip)), long double>::value), "");
343*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexpf(0, &ip)), float>::value), "");
344*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::frexpl(0, &ip)), long double>::value), "");
345*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(frexp(Ambiguous(), &ip)), Ambiguous>::value), "");
346*0a6a1f1dSLionel Sambuc assert(std::frexp(0, &ip) == 0);
347*0a6a1f1dSLionel Sambuc }
348*0a6a1f1dSLionel Sambuc
test_ldexp()349*0a6a1f1dSLionel Sambuc void test_ldexp()
350*0a6a1f1dSLionel Sambuc {
351*0a6a1f1dSLionel Sambuc int ip = 1;
352*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((float)0, ip)), float>::value), "");
353*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((bool)0, ip)), double>::value), "");
354*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((unsigned short)0, ip)), double>::value), "");
355*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((int)0, ip)), double>::value), "");
356*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((unsigned int)0, ip)), double>::value), "");
357*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((long)0, ip)), double>::value), "");
358*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((unsigned long)0, ip)), double>::value), "");
359*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((long long)0, ip)), double>::value), "");
360*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((unsigned long long)0, ip)), double>::value), "");
361*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((double)0, ip)), double>::value), "");
362*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexp((long double)0, ip)), long double>::value), "");
363*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexpf(0, ip)), float>::value), "");
364*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ldexpl(0, ip)), long double>::value), "");
365*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(ldexp(Ambiguous(), ip)), Ambiguous>::value), "");
366*0a6a1f1dSLionel Sambuc assert(std::ldexp(1, ip) == 2);
367*0a6a1f1dSLionel Sambuc }
368*0a6a1f1dSLionel Sambuc
test_log()369*0a6a1f1dSLionel Sambuc void test_log()
370*0a6a1f1dSLionel Sambuc {
371*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((float)0)), float>::value), "");
372*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((bool)0)), double>::value), "");
373*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((unsigned short)0)), double>::value), "");
374*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((int)0)), double>::value), "");
375*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((unsigned int)0)), double>::value), "");
376*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((long)0)), double>::value), "");
377*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((unsigned long)0)), double>::value), "");
378*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((long long)0)), double>::value), "");
379*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((unsigned long long)0)), double>::value), "");
380*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((double)0)), double>::value), "");
381*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log((long double)0)), long double>::value), "");
382*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logf(0)), float>::value), "");
383*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logl(0)), long double>::value), "");
384*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(log(Ambiguous())), Ambiguous>::value), "");
385*0a6a1f1dSLionel Sambuc assert(std::log(1) == 0);
386*0a6a1f1dSLionel Sambuc }
387*0a6a1f1dSLionel Sambuc
test_log10()388*0a6a1f1dSLionel Sambuc void test_log10()
389*0a6a1f1dSLionel Sambuc {
390*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((float)0)), float>::value), "");
391*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((bool)0)), double>::value), "");
392*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((unsigned short)0)), double>::value), "");
393*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((int)0)), double>::value), "");
394*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((unsigned int)0)), double>::value), "");
395*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((long)0)), double>::value), "");
396*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((unsigned long)0)), double>::value), "");
397*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((long long)0)), double>::value), "");
398*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((unsigned long long)0)), double>::value), "");
399*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((double)0)), double>::value), "");
400*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10((long double)0)), long double>::value), "");
401*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10f(0)), float>::value), "");
402*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log10l(0)), long double>::value), "");
403*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(log10(Ambiguous())), Ambiguous>::value), "");
404*0a6a1f1dSLionel Sambuc assert(std::log10(1) == 0);
405*0a6a1f1dSLionel Sambuc }
406*0a6a1f1dSLionel Sambuc
test_modf()407*0a6a1f1dSLionel Sambuc void test_modf()
408*0a6a1f1dSLionel Sambuc {
409*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::modf((float)0, (float*)0)), float>::value), "");
410*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::modf((double)0, (double*)0)), double>::value), "");
411*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::modf((long double)0, (long double*)0)), long double>::value), "");
412*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::modff(0, (float*)0)), float>::value), "");
413*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::modfl(0, (long double*)0)), long double>::value), "");
414*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(modf(Ambiguous(), (Ambiguous*)0)), Ambiguous>::value), "");
415*0a6a1f1dSLionel Sambuc double i;
416*0a6a1f1dSLionel Sambuc assert(std::modf(1., &i) == 0);
417*0a6a1f1dSLionel Sambuc }
418*0a6a1f1dSLionel Sambuc
test_pow()419*0a6a1f1dSLionel Sambuc void test_pow()
420*0a6a1f1dSLionel Sambuc {
421*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((float)0, (float)0)), float>::value), "");
422*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((bool)0, (float)0)), double>::value), "");
423*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((unsigned short)0, (double)0)), double>::value), "");
424*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((int)0, (long double)0)), long double>::value), "");
425*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((float)0, (unsigned int)0)), double>::value), "");
426*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((double)0, (long)0)), double>::value), "");
427*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((long double)0, (unsigned long)0)), long double>::value), "");
428*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((int)0, (long long)0)), double>::value), "");
429*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((int)0, (unsigned long long)0)), double>::value), "");
430*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((double)0, (double)0)), double>::value), "");
431*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((long double)0, (long double)0)), long double>::value), "");
432*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((float)0, (double)0)), double>::value), "");
433*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((float)0, (long double)0)), long double>::value), "");
434*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((double)0, (long double)0)), long double>::value), "");
435*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::powf(0,0)), float>::value), "");
436*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::powl(0,0)), long double>::value), "");
437*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::pow((int)0, (int)0)), double>::value), "");
438*0a6a1f1dSLionel Sambuc // static_assert((std::is_same<decltype(std::pow(Value<int>(), (int)0)), double>::value), "");
439*0a6a1f1dSLionel Sambuc // static_assert((std::is_same<decltype(std::pow(Value<long double>(), (float)0)), long double>::value), "");
440*0a6a1f1dSLionel Sambuc // static_assert((std::is_same<decltype(std::pow((float) 0, Value<float>())), float>::value), "");
441*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(pow(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
442*0a6a1f1dSLionel Sambuc assert(std::pow(1,1) == 1);
443*0a6a1f1dSLionel Sambuc // assert(std::pow(Value<int,1>(), Value<float,1>()) == 1);
444*0a6a1f1dSLionel Sambuc // assert(std::pow(1.0f, Value<double,1>()) == 1);
445*0a6a1f1dSLionel Sambuc // assert(std::pow(1.0, Value<int,1>()) == 1);
446*0a6a1f1dSLionel Sambuc // assert(std::pow(Value<long double,1>(), 1LL) == 1);
447*0a6a1f1dSLionel Sambuc }
448*0a6a1f1dSLionel Sambuc
test_sin()449*0a6a1f1dSLionel Sambuc void test_sin()
450*0a6a1f1dSLionel Sambuc {
451*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((float)0)), float>::value), "");
452*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((bool)0)), double>::value), "");
453*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((unsigned short)0)), double>::value), "");
454*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((int)0)), double>::value), "");
455*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((unsigned int)0)), double>::value), "");
456*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((long)0)), double>::value), "");
457*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((unsigned long)0)), double>::value), "");
458*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((long long)0)), double>::value), "");
459*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((unsigned long long)0)), double>::value), "");
460*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((double)0)), double>::value), "");
461*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sin((long double)0)), long double>::value), "");
462*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinf(0)), float>::value), "");
463*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinl(0)), long double>::value), "");
464*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(sin(Ambiguous())), Ambiguous>::value), "");
465*0a6a1f1dSLionel Sambuc assert(std::sin(0) == 0);
466*0a6a1f1dSLionel Sambuc }
467*0a6a1f1dSLionel Sambuc
test_sinh()468*0a6a1f1dSLionel Sambuc void test_sinh()
469*0a6a1f1dSLionel Sambuc {
470*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((float)0)), float>::value), "");
471*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((bool)0)), double>::value), "");
472*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((unsigned short)0)), double>::value), "");
473*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((int)0)), double>::value), "");
474*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((unsigned int)0)), double>::value), "");
475*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((long)0)), double>::value), "");
476*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((unsigned long)0)), double>::value), "");
477*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((long long)0)), double>::value), "");
478*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((unsigned long long)0)), double>::value), "");
479*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((double)0)), double>::value), "");
480*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinh((long double)0)), long double>::value), "");
481*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinhf(0)), float>::value), "");
482*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sinhl(0)), long double>::value), "");
483*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(sinh(Ambiguous())), Ambiguous>::value), "");
484*0a6a1f1dSLionel Sambuc assert(std::sinh(0) == 0);
485*0a6a1f1dSLionel Sambuc }
486*0a6a1f1dSLionel Sambuc
test_sqrt()487*0a6a1f1dSLionel Sambuc void test_sqrt()
488*0a6a1f1dSLionel Sambuc {
489*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((float)0)), float>::value), "");
490*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((bool)0)), double>::value), "");
491*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((unsigned short)0)), double>::value), "");
492*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((int)0)), double>::value), "");
493*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((unsigned int)0)), double>::value), "");
494*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((long)0)), double>::value), "");
495*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((unsigned long)0)), double>::value), "");
496*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((long long)0)), double>::value), "");
497*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((unsigned long long)0)), double>::value), "");
498*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((double)0)), double>::value), "");
499*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrt((long double)0)), long double>::value), "");
500*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrtf(0)), float>::value), "");
501*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::sqrtl(0)), long double>::value), "");
502*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(sqrt(Ambiguous())), Ambiguous>::value), "");
503*0a6a1f1dSLionel Sambuc assert(std::sqrt(4) == 2);
504*0a6a1f1dSLionel Sambuc }
505*0a6a1f1dSLionel Sambuc
test_tan()506*0a6a1f1dSLionel Sambuc void test_tan()
507*0a6a1f1dSLionel Sambuc {
508*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((float)0)), float>::value), "");
509*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((bool)0)), double>::value), "");
510*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((unsigned short)0)), double>::value), "");
511*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((int)0)), double>::value), "");
512*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((unsigned int)0)), double>::value), "");
513*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((long)0)), double>::value), "");
514*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((unsigned long)0)), double>::value), "");
515*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((long long)0)), double>::value), "");
516*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((unsigned long long)0)), double>::value), "");
517*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((double)0)), double>::value), "");
518*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tan((long double)0)), long double>::value), "");
519*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanf(0)), float>::value), "");
520*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanl(0)), long double>::value), "");
521*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(tan(Ambiguous())), Ambiguous>::value), "");
522*0a6a1f1dSLionel Sambuc assert(std::tan(0) == 0);
523*0a6a1f1dSLionel Sambuc }
524*0a6a1f1dSLionel Sambuc
test_tanh()525*0a6a1f1dSLionel Sambuc void test_tanh()
526*0a6a1f1dSLionel Sambuc {
527*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((float)0)), float>::value), "");
528*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((bool)0)), double>::value), "");
529*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((unsigned short)0)), double>::value), "");
530*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((int)0)), double>::value), "");
531*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((unsigned int)0)), double>::value), "");
532*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((long)0)), double>::value), "");
533*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((unsigned long)0)), double>::value), "");
534*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((long long)0)), double>::value), "");
535*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((unsigned long long)0)), double>::value), "");
536*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((double)0)), double>::value), "");
537*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanh((long double)0)), long double>::value), "");
538*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanhf(0)), float>::value), "");
539*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tanhl(0)), long double>::value), "");
540*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(tanh(Ambiguous())), Ambiguous>::value), "");
541*0a6a1f1dSLionel Sambuc assert(std::tanh(0) == 0);
542*0a6a1f1dSLionel Sambuc }
543*0a6a1f1dSLionel Sambuc
test_signbit()544*0a6a1f1dSLionel Sambuc void test_signbit()
545*0a6a1f1dSLionel Sambuc {
546*0a6a1f1dSLionel Sambuc #ifdef signbit
547*0a6a1f1dSLionel Sambuc #error signbit defined
548*0a6a1f1dSLionel Sambuc #endif
549*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::signbit((float)0)), bool>::value), "");
550*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::signbit((double)0)), bool>::value), "");
551*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::signbit(0)), bool>::value), "");
552*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::signbit((long double)0)), bool>::value), "");
553*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(signbit(Ambiguous())), Ambiguous>::value), "");
554*0a6a1f1dSLionel Sambuc assert(std::signbit(-1.0) == true);
555*0a6a1f1dSLionel Sambuc }
556*0a6a1f1dSLionel Sambuc
test_fpclassify()557*0a6a1f1dSLionel Sambuc void test_fpclassify()
558*0a6a1f1dSLionel Sambuc {
559*0a6a1f1dSLionel Sambuc #ifdef fpclassify
560*0a6a1f1dSLionel Sambuc #error fpclassify defined
561*0a6a1f1dSLionel Sambuc #endif
562*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fpclassify((float)0)), int>::value), "");
563*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fpclassify((double)0)), int>::value), "");
564*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fpclassify(0)), int>::value), "");
565*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fpclassify((long double)0)), int>::value), "");
566*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(fpclassify(Ambiguous())), Ambiguous>::value), "");
567*0a6a1f1dSLionel Sambuc assert(std::fpclassify(-1.0) == FP_NORMAL);
568*0a6a1f1dSLionel Sambuc }
569*0a6a1f1dSLionel Sambuc
test_isfinite()570*0a6a1f1dSLionel Sambuc void test_isfinite()
571*0a6a1f1dSLionel Sambuc {
572*0a6a1f1dSLionel Sambuc #ifdef isfinite
573*0a6a1f1dSLionel Sambuc #error isfinite defined
574*0a6a1f1dSLionel Sambuc #endif
575*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isfinite((float)0)), bool>::value), "");
576*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isfinite((double)0)), bool>::value), "");
577*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isfinite(0)), bool>::value), "");
578*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isfinite((long double)0)), bool>::value), "");
579*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(isfinite(Ambiguous())), Ambiguous>::value), "");
580*0a6a1f1dSLionel Sambuc assert(std::isfinite(-1.0) == true);
581*0a6a1f1dSLionel Sambuc }
582*0a6a1f1dSLionel Sambuc
test_isnormal()583*0a6a1f1dSLionel Sambuc void test_isnormal()
584*0a6a1f1dSLionel Sambuc {
585*0a6a1f1dSLionel Sambuc #ifdef isnormal
586*0a6a1f1dSLionel Sambuc #error isnormal defined
587*0a6a1f1dSLionel Sambuc #endif
588*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isnormal((float)0)), bool>::value), "");
589*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isnormal((double)0)), bool>::value), "");
590*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isnormal(0)), bool>::value), "");
591*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isnormal((long double)0)), bool>::value), "");
592*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(isnormal(Ambiguous())), Ambiguous>::value), "");
593*0a6a1f1dSLionel Sambuc assert(std::isnormal(-1.0) == true);
594*0a6a1f1dSLionel Sambuc }
595*0a6a1f1dSLionel Sambuc
test_isgreater()596*0a6a1f1dSLionel Sambuc void test_isgreater()
597*0a6a1f1dSLionel Sambuc {
598*0a6a1f1dSLionel Sambuc #ifdef isgreater
599*0a6a1f1dSLionel Sambuc #error isgreater defined
600*0a6a1f1dSLionel Sambuc #endif
601*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater((float)0, (float)0)), bool>::value), "");
602*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater((float)0, (double)0)), bool>::value), "");
603*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater((float)0, (long double)0)), bool>::value), "");
604*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater((double)0, (float)0)), bool>::value), "");
605*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater((double)0, (double)0)), bool>::value), "");
606*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater(0, (double)0)), bool>::value), "");
607*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater((double)0, (long double)0)), bool>::value), "");
608*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater((long double)0, (float)0)), bool>::value), "");
609*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater((long double)0, (double)0)), bool>::value), "");
610*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreater((long double)0, (long double)0)), bool>::value), "");
611*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(isgreater(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
612*0a6a1f1dSLionel Sambuc assert(std::isgreater(-1.0, 0.F) == false);
613*0a6a1f1dSLionel Sambuc }
614*0a6a1f1dSLionel Sambuc
test_isgreaterequal()615*0a6a1f1dSLionel Sambuc void test_isgreaterequal()
616*0a6a1f1dSLionel Sambuc {
617*0a6a1f1dSLionel Sambuc #ifdef isgreaterequal
618*0a6a1f1dSLionel Sambuc #error isgreaterequal defined
619*0a6a1f1dSLionel Sambuc #endif
620*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal((float)0, (float)0)), bool>::value), "");
621*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal((float)0, (double)0)), bool>::value), "");
622*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal((float)0, (long double)0)), bool>::value), "");
623*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal((double)0, (float)0)), bool>::value), "");
624*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal((double)0, (double)0)), bool>::value), "");
625*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal(0, (double)0)), bool>::value), "");
626*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal((double)0, (long double)0)), bool>::value), "");
627*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal((long double)0, (float)0)), bool>::value), "");
628*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal((long double)0, (double)0)), bool>::value), "");
629*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isgreaterequal((long double)0, (long double)0)), bool>::value), "");
630*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
631*0a6a1f1dSLionel Sambuc assert(std::isgreaterequal(-1.0, 0.F) == false);
632*0a6a1f1dSLionel Sambuc }
633*0a6a1f1dSLionel Sambuc
test_isless()634*0a6a1f1dSLionel Sambuc void test_isless()
635*0a6a1f1dSLionel Sambuc {
636*0a6a1f1dSLionel Sambuc #ifdef isless
637*0a6a1f1dSLionel Sambuc #error isless defined
638*0a6a1f1dSLionel Sambuc #endif
639*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless((float)0, (float)0)), bool>::value), "");
640*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless((float)0, (double)0)), bool>::value), "");
641*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless((float)0, (long double)0)), bool>::value), "");
642*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless((double)0, (float)0)), bool>::value), "");
643*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless((double)0, (double)0)), bool>::value), "");
644*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless(0, (double)0)), bool>::value), "");
645*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless((double)0, (long double)0)), bool>::value), "");
646*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless((long double)0, (float)0)), bool>::value), "");
647*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless((long double)0, (double)0)), bool>::value), "");
648*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isless((long double)0, (long double)0)), bool>::value), "");
649*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(isless(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
650*0a6a1f1dSLionel Sambuc assert(std::isless(-1.0, 0.F) == true);
651*0a6a1f1dSLionel Sambuc }
652*0a6a1f1dSLionel Sambuc
test_islessequal()653*0a6a1f1dSLionel Sambuc void test_islessequal()
654*0a6a1f1dSLionel Sambuc {
655*0a6a1f1dSLionel Sambuc #ifdef islessequal
656*0a6a1f1dSLionel Sambuc #error islessequal defined
657*0a6a1f1dSLionel Sambuc #endif
658*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal((float)0, (float)0)), bool>::value), "");
659*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal((float)0, (double)0)), bool>::value), "");
660*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal((float)0, (long double)0)), bool>::value), "");
661*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal((double)0, (float)0)), bool>::value), "");
662*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal((double)0, (double)0)), bool>::value), "");
663*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal(0, (double)0)), bool>::value), "");
664*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal((double)0, (long double)0)), bool>::value), "");
665*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal((long double)0, (float)0)), bool>::value), "");
666*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal((long double)0, (double)0)), bool>::value), "");
667*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessequal((long double)0, (long double)0)), bool>::value), "");
668*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(islessequal(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
669*0a6a1f1dSLionel Sambuc assert(std::islessequal(-1.0, 0.F) == true);
670*0a6a1f1dSLionel Sambuc }
671*0a6a1f1dSLionel Sambuc
test_islessgreater()672*0a6a1f1dSLionel Sambuc void test_islessgreater()
673*0a6a1f1dSLionel Sambuc {
674*0a6a1f1dSLionel Sambuc #ifdef islessgreater
675*0a6a1f1dSLionel Sambuc #error islessgreater defined
676*0a6a1f1dSLionel Sambuc #endif
677*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater((float)0, (float)0)), bool>::value), "");
678*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater((float)0, (double)0)), bool>::value), "");
679*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater((float)0, (long double)0)), bool>::value), "");
680*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater((double)0, (float)0)), bool>::value), "");
681*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater((double)0, (double)0)), bool>::value), "");
682*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater(0, (double)0)), bool>::value), "");
683*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater((double)0, (long double)0)), bool>::value), "");
684*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater((long double)0, (float)0)), bool>::value), "");
685*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater((long double)0, (double)0)), bool>::value), "");
686*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::islessgreater((long double)0, (long double)0)), bool>::value), "");
687*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(islessgreater(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
688*0a6a1f1dSLionel Sambuc assert(std::islessgreater(-1.0, 0.F) == true);
689*0a6a1f1dSLionel Sambuc }
690*0a6a1f1dSLionel Sambuc
test_isunordered()691*0a6a1f1dSLionel Sambuc void test_isunordered()
692*0a6a1f1dSLionel Sambuc {
693*0a6a1f1dSLionel Sambuc #ifdef isunordered
694*0a6a1f1dSLionel Sambuc #error isunordered defined
695*0a6a1f1dSLionel Sambuc #endif
696*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered((float)0, (float)0)), bool>::value), "");
697*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered((float)0, (double)0)), bool>::value), "");
698*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered((float)0, (long double)0)), bool>::value), "");
699*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered((double)0, (float)0)), bool>::value), "");
700*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered((double)0, (double)0)), bool>::value), "");
701*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered(0, (double)0)), bool>::value), "");
702*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered((double)0, (long double)0)), bool>::value), "");
703*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered((long double)0, (float)0)), bool>::value), "");
704*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered((long double)0, (double)0)), bool>::value), "");
705*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::isunordered((long double)0, (long double)0)), bool>::value), "");
706*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(isunordered(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
707*0a6a1f1dSLionel Sambuc assert(std::isunordered(-1.0, 0.F) == false);
708*0a6a1f1dSLionel Sambuc }
709*0a6a1f1dSLionel Sambuc
test_acosh()710*0a6a1f1dSLionel Sambuc void test_acosh()
711*0a6a1f1dSLionel Sambuc {
712*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((float)0)), float>::value), "");
713*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((bool)0)), double>::value), "");
714*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((unsigned short)0)), double>::value), "");
715*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((int)0)), double>::value), "");
716*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((unsigned int)0)), double>::value), "");
717*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((long)0)), double>::value), "");
718*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((unsigned long)0)), double>::value), "");
719*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((long long)0)), double>::value), "");
720*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((unsigned long long)0)), double>::value), "");
721*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((double)0)), double>::value), "");
722*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acosh((long double)0)), long double>::value), "");
723*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acoshf(0)), float>::value), "");
724*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::acoshl(0)), long double>::value), "");
725*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(acosh(Ambiguous())), Ambiguous>::value), "");
726*0a6a1f1dSLionel Sambuc assert(std::acosh(1) == 0);
727*0a6a1f1dSLionel Sambuc }
728*0a6a1f1dSLionel Sambuc
test_asinh()729*0a6a1f1dSLionel Sambuc void test_asinh()
730*0a6a1f1dSLionel Sambuc {
731*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((float)0)), float>::value), "");
732*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((bool)0)), double>::value), "");
733*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((unsigned short)0)), double>::value), "");
734*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((int)0)), double>::value), "");
735*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((unsigned int)0)), double>::value), "");
736*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((long)0)), double>::value), "");
737*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((unsigned long)0)), double>::value), "");
738*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((long long)0)), double>::value), "");
739*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((unsigned long long)0)), double>::value), "");
740*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((double)0)), double>::value), "");
741*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinh((long double)0)), long double>::value), "");
742*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinhf(0)), float>::value), "");
743*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::asinhl(0)), long double>::value), "");
744*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(asinh(Ambiguous())), Ambiguous>::value), "");
745*0a6a1f1dSLionel Sambuc assert(std::asinh(0) == 0);
746*0a6a1f1dSLionel Sambuc }
747*0a6a1f1dSLionel Sambuc
test_atanh()748*0a6a1f1dSLionel Sambuc void test_atanh()
749*0a6a1f1dSLionel Sambuc {
750*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((float)0)), float>::value), "");
751*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((bool)0)), double>::value), "");
752*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((unsigned short)0)), double>::value), "");
753*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((int)0)), double>::value), "");
754*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((unsigned int)0)), double>::value), "");
755*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((long)0)), double>::value), "");
756*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((unsigned long)0)), double>::value), "");
757*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((long long)0)), double>::value), "");
758*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((unsigned long long)0)), double>::value), "");
759*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((double)0)), double>::value), "");
760*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanh((long double)0)), long double>::value), "");
761*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanhf(0)), float>::value), "");
762*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::atanhl(0)), long double>::value), "");
763*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(atanh(Ambiguous())), Ambiguous>::value), "");
764*0a6a1f1dSLionel Sambuc assert(std::atanh(0) == 0);
765*0a6a1f1dSLionel Sambuc }
766*0a6a1f1dSLionel Sambuc
test_cbrt()767*0a6a1f1dSLionel Sambuc void test_cbrt()
768*0a6a1f1dSLionel Sambuc {
769*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((float)0)), float>::value), "");
770*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((bool)0)), double>::value), "");
771*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((unsigned short)0)), double>::value), "");
772*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((int)0)), double>::value), "");
773*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((unsigned int)0)), double>::value), "");
774*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((long)0)), double>::value), "");
775*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((unsigned long)0)), double>::value), "");
776*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((long long)0)), double>::value), "");
777*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((unsigned long long)0)), double>::value), "");
778*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((double)0)), double>::value), "");
779*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrt((long double)0)), long double>::value), "");
780*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrtf(0)), float>::value), "");
781*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::cbrtl(0)), long double>::value), "");
782*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(cbrt(Ambiguous())), Ambiguous>::value), "");
783*0a6a1f1dSLionel Sambuc assert(std::cbrt(1) == 1);
784*0a6a1f1dSLionel Sambuc }
785*0a6a1f1dSLionel Sambuc
test_copysign()786*0a6a1f1dSLionel Sambuc void test_copysign()
787*0a6a1f1dSLionel Sambuc {
788*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((float)0, (float)0)), float>::value), "");
789*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((bool)0, (float)0)), double>::value), "");
790*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((unsigned short)0, (double)0)), double>::value), "");
791*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((int)0, (long double)0)), long double>::value), "");
792*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((float)0, (unsigned int)0)), double>::value), "");
793*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((double)0, (long)0)), double>::value), "");
794*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((long double)0, (unsigned long)0)), long double>::value), "");
795*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((int)0, (long long)0)), double>::value), "");
796*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((int)0, (unsigned long long)0)), double>::value), "");
797*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((double)0, (double)0)), double>::value), "");
798*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((long double)0, (long double)0)), long double>::value), "");
799*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((float)0, (double)0)), double>::value), "");
800*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((float)0, (long double)0)), long double>::value), "");
801*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((double)0, (long double)0)), long double>::value), "");
802*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysignf(0,0)), float>::value), "");
803*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysignl(0,0)), long double>::value), "");
804*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::copysign((int)0, (int)0)), double>::value), "");
805*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(copysign(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
806*0a6a1f1dSLionel Sambuc assert(std::copysign(1,1) == 1);
807*0a6a1f1dSLionel Sambuc }
808*0a6a1f1dSLionel Sambuc
test_erf()809*0a6a1f1dSLionel Sambuc void test_erf()
810*0a6a1f1dSLionel Sambuc {
811*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((float)0)), float>::value), "");
812*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((bool)0)), double>::value), "");
813*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((unsigned short)0)), double>::value), "");
814*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((int)0)), double>::value), "");
815*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((unsigned int)0)), double>::value), "");
816*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((long)0)), double>::value), "");
817*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((unsigned long)0)), double>::value), "");
818*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((long long)0)), double>::value), "");
819*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((unsigned long long)0)), double>::value), "");
820*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((double)0)), double>::value), "");
821*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erf((long double)0)), long double>::value), "");
822*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erff(0)), float>::value), "");
823*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfl(0)), long double>::value), "");
824*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(erf(Ambiguous())), Ambiguous>::value), "");
825*0a6a1f1dSLionel Sambuc assert(std::erf(0) == 0);
826*0a6a1f1dSLionel Sambuc }
827*0a6a1f1dSLionel Sambuc
test_erfc()828*0a6a1f1dSLionel Sambuc void test_erfc()
829*0a6a1f1dSLionel Sambuc {
830*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((float)0)), float>::value), "");
831*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((bool)0)), double>::value), "");
832*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((unsigned short)0)), double>::value), "");
833*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((int)0)), double>::value), "");
834*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((unsigned int)0)), double>::value), "");
835*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((long)0)), double>::value), "");
836*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((unsigned long)0)), double>::value), "");
837*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((long long)0)), double>::value), "");
838*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((unsigned long long)0)), double>::value), "");
839*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((double)0)), double>::value), "");
840*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfc((long double)0)), long double>::value), "");
841*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfcf(0)), float>::value), "");
842*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::erfcl(0)), long double>::value), "");
843*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(erfc(Ambiguous())), Ambiguous>::value), "");
844*0a6a1f1dSLionel Sambuc assert(std::erfc(0) == 1);
845*0a6a1f1dSLionel Sambuc }
846*0a6a1f1dSLionel Sambuc
test_exp2()847*0a6a1f1dSLionel Sambuc void test_exp2()
848*0a6a1f1dSLionel Sambuc {
849*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((float)0)), float>::value), "");
850*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((bool)0)), double>::value), "");
851*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((unsigned short)0)), double>::value), "");
852*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((int)0)), double>::value), "");
853*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((unsigned int)0)), double>::value), "");
854*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((long)0)), double>::value), "");
855*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((unsigned long)0)), double>::value), "");
856*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((long long)0)), double>::value), "");
857*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((unsigned long long)0)), double>::value), "");
858*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((double)0)), double>::value), "");
859*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2((long double)0)), long double>::value), "");
860*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2f(0)), float>::value), "");
861*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::exp2l(0)), long double>::value), "");
862*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(exp2(Ambiguous())), Ambiguous>::value), "");
863*0a6a1f1dSLionel Sambuc assert(std::exp2(1) == 2);
864*0a6a1f1dSLionel Sambuc }
865*0a6a1f1dSLionel Sambuc
test_expm1()866*0a6a1f1dSLionel Sambuc void test_expm1()
867*0a6a1f1dSLionel Sambuc {
868*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((float)0)), float>::value), "");
869*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((bool)0)), double>::value), "");
870*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((unsigned short)0)), double>::value), "");
871*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((int)0)), double>::value), "");
872*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((unsigned int)0)), double>::value), "");
873*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((long)0)), double>::value), "");
874*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((unsigned long)0)), double>::value), "");
875*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((long long)0)), double>::value), "");
876*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((unsigned long long)0)), double>::value), "");
877*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((double)0)), double>::value), "");
878*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1((long double)0)), long double>::value), "");
879*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1f(0)), float>::value), "");
880*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::expm1l(0)), long double>::value), "");
881*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(expm1(Ambiguous())), Ambiguous>::value), "");
882*0a6a1f1dSLionel Sambuc assert(std::expm1(0) == 0);
883*0a6a1f1dSLionel Sambuc }
884*0a6a1f1dSLionel Sambuc
test_fdim()885*0a6a1f1dSLionel Sambuc void test_fdim()
886*0a6a1f1dSLionel Sambuc {
887*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((float)0, (float)0)), float>::value), "");
888*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((bool)0, (float)0)), double>::value), "");
889*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((unsigned short)0, (double)0)), double>::value), "");
890*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((int)0, (long double)0)), long double>::value), "");
891*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((float)0, (unsigned int)0)), double>::value), "");
892*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((double)0, (long)0)), double>::value), "");
893*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((long double)0, (unsigned long)0)), long double>::value), "");
894*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((int)0, (long long)0)), double>::value), "");
895*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((int)0, (unsigned long long)0)), double>::value), "");
896*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((double)0, (double)0)), double>::value), "");
897*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((long double)0, (long double)0)), long double>::value), "");
898*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((float)0, (double)0)), double>::value), "");
899*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((float)0, (long double)0)), long double>::value), "");
900*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((double)0, (long double)0)), long double>::value), "");
901*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdimf(0,0)), float>::value), "");
902*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdiml(0,0)), long double>::value), "");
903*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fdim((int)0, (int)0)), double>::value), "");
904*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(fdim(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
905*0a6a1f1dSLionel Sambuc assert(std::fdim(1,0) == 1);
906*0a6a1f1dSLionel Sambuc }
907*0a6a1f1dSLionel Sambuc
test_fma()908*0a6a1f1dSLionel Sambuc void test_fma()
909*0a6a1f1dSLionel Sambuc {
910*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((bool)0, (float)0, (float)0)), double>::value), "");
911*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((char)0, (float)0, (float)0)), double>::value), "");
912*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((unsigned)0, (float)0, (float)0)), double>::value), "");
913*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((float)0, (int)0, (float)0)), double>::value), "");
914*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((float)0, (long)0, (float)0)), double>::value), "");
915*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((float)0, (float)0, (unsigned long long)0)), double>::value), "");
916*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((float)0, (float)0, (double)0)), double>::value), "");
917*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((float)0, (float)0, (long double)0)), long double>::value), "");
918*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((float)0, (float)0, (float)0)), float>::value), "");
919*0a6a1f1dSLionel Sambuc
920*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((bool)0, (double)0, (double)0)), double>::value), "");
921*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((char)0, (double)0, (double)0)), double>::value), "");
922*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((unsigned)0, (double)0, (double)0)), double>::value), "");
923*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((double)0, (int)0, (double)0)), double>::value), "");
924*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((double)0, (long)0, (double)0)), double>::value), "");
925*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((double)0, (double)0, (unsigned long long)0)), double>::value), "");
926*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((double)0, (double)0, (float)0)), double>::value), "");
927*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((double)0, (double)0, (long double)0)), long double>::value), "");
928*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((double)0, (double)0, (double)0)), double>::value), "");
929*0a6a1f1dSLionel Sambuc
930*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((bool)0, (long double)0, (long double)0)), long double>::value), "");
931*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((char)0, (long double)0, (long double)0)), long double>::value), "");
932*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((unsigned)0, (long double)0, (long double)0)), long double>::value), "");
933*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((long double)0, (int)0, (long double)0)), long double>::value), "");
934*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((long double)0, (long)0, (long double)0)), long double>::value), "");
935*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((long double)0, (long double)0, (unsigned long long)0)), long double>::value), "");
936*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((long double)0, (long double)0, (float)0)), long double>::value), "");
937*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((double)0, (long double)0, (long double)0)), long double>::value), "");
938*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fma((long double)0, (long double)0, (long double)0)), long double>::value), "");
939*0a6a1f1dSLionel Sambuc
940*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmaf(0,0,0)), float>::value), "");
941*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmal(0,0,0)), long double>::value), "");
942*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(fma(Ambiguous(), Ambiguous(), Ambiguous())), Ambiguous>::value), "");
943*0a6a1f1dSLionel Sambuc assert(std::fma(1,1,1) == 2);
944*0a6a1f1dSLionel Sambuc }
945*0a6a1f1dSLionel Sambuc
test_fmax()946*0a6a1f1dSLionel Sambuc void test_fmax()
947*0a6a1f1dSLionel Sambuc {
948*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((float)0, (float)0)), float>::value), "");
949*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((bool)0, (float)0)), double>::value), "");
950*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((unsigned short)0, (double)0)), double>::value), "");
951*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((int)0, (long double)0)), long double>::value), "");
952*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((float)0, (unsigned int)0)), double>::value), "");
953*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((double)0, (long)0)), double>::value), "");
954*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((long double)0, (unsigned long)0)), long double>::value), "");
955*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((int)0, (long long)0)), double>::value), "");
956*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((int)0, (unsigned long long)0)), double>::value), "");
957*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((double)0, (double)0)), double>::value), "");
958*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((long double)0, (long double)0)), long double>::value), "");
959*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((float)0, (double)0)), double>::value), "");
960*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((float)0, (long double)0)), long double>::value), "");
961*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((double)0, (long double)0)), long double>::value), "");
962*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmaxf(0,0)), float>::value), "");
963*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmaxl(0,0)), long double>::value), "");
964*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmax((int)0, (int)0)), double>::value), "");
965*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(fmax(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
966*0a6a1f1dSLionel Sambuc assert(std::fmax(1,0) == 1);
967*0a6a1f1dSLionel Sambuc }
968*0a6a1f1dSLionel Sambuc
test_fmin()969*0a6a1f1dSLionel Sambuc void test_fmin()
970*0a6a1f1dSLionel Sambuc {
971*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((float)0, (float)0)), float>::value), "");
972*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((bool)0, (float)0)), double>::value), "");
973*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((unsigned short)0, (double)0)), double>::value), "");
974*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((int)0, (long double)0)), long double>::value), "");
975*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((float)0, (unsigned int)0)), double>::value), "");
976*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((double)0, (long)0)), double>::value), "");
977*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((long double)0, (unsigned long)0)), long double>::value), "");
978*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((int)0, (long long)0)), double>::value), "");
979*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((int)0, (unsigned long long)0)), double>::value), "");
980*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((double)0, (double)0)), double>::value), "");
981*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((long double)0, (long double)0)), long double>::value), "");
982*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((float)0, (double)0)), double>::value), "");
983*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((float)0, (long double)0)), long double>::value), "");
984*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((double)0, (long double)0)), long double>::value), "");
985*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fminf(0,0)), float>::value), "");
986*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fminl(0,0)), long double>::value), "");
987*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::fmin((int)0, (int)0)), double>::value), "");
988*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(fmin(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
989*0a6a1f1dSLionel Sambuc assert(std::fmin(1,0) == 0);
990*0a6a1f1dSLionel Sambuc }
991*0a6a1f1dSLionel Sambuc
test_hypot()992*0a6a1f1dSLionel Sambuc void test_hypot()
993*0a6a1f1dSLionel Sambuc {
994*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((float)0, (float)0)), float>::value), "");
995*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((bool)0, (float)0)), double>::value), "");
996*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((unsigned short)0, (double)0)), double>::value), "");
997*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((int)0, (long double)0)), long double>::value), "");
998*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((float)0, (unsigned int)0)), double>::value), "");
999*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((double)0, (long)0)), double>::value), "");
1000*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((long double)0, (unsigned long)0)), long double>::value), "");
1001*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((int)0, (long long)0)), double>::value), "");
1002*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((int)0, (unsigned long long)0)), double>::value), "");
1003*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((double)0, (double)0)), double>::value), "");
1004*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((long double)0, (long double)0)), long double>::value), "");
1005*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((float)0, (double)0)), double>::value), "");
1006*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((float)0, (long double)0)), long double>::value), "");
1007*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((double)0, (long double)0)), long double>::value), "");
1008*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypotf(0,0)), float>::value), "");
1009*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypotl(0,0)), long double>::value), "");
1010*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::hypot((int)0, (int)0)), double>::value), "");
1011*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(hypot(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
1012*0a6a1f1dSLionel Sambuc assert(std::hypot(3,4) == 5);
1013*0a6a1f1dSLionel Sambuc }
1014*0a6a1f1dSLionel Sambuc
test_ilogb()1015*0a6a1f1dSLionel Sambuc void test_ilogb()
1016*0a6a1f1dSLionel Sambuc {
1017*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((float)0)), int>::value), "");
1018*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((bool)0)), int>::value), "");
1019*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((unsigned short)0)), int>::value), "");
1020*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((int)0)), int>::value), "");
1021*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((unsigned int)0)), int>::value), "");
1022*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((long)0)), int>::value), "");
1023*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((unsigned long)0)), int>::value), "");
1024*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((long long)0)), int>::value), "");
1025*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((unsigned long long)0)), int>::value), "");
1026*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((double)0)), int>::value), "");
1027*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogb((long double)0)), int>::value), "");
1028*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogbf(0)), int>::value), "");
1029*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::ilogbl(0)), int>::value), "");
1030*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(ilogb(Ambiguous())), Ambiguous>::value), "");
1031*0a6a1f1dSLionel Sambuc assert(std::ilogb(1) == 0);
1032*0a6a1f1dSLionel Sambuc }
1033*0a6a1f1dSLionel Sambuc
test_lgamma()1034*0a6a1f1dSLionel Sambuc void test_lgamma()
1035*0a6a1f1dSLionel Sambuc {
1036*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((float)0)), float>::value), "");
1037*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((bool)0)), double>::value), "");
1038*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((unsigned short)0)), double>::value), "");
1039*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((int)0)), double>::value), "");
1040*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((unsigned int)0)), double>::value), "");
1041*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((long)0)), double>::value), "");
1042*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((unsigned long)0)), double>::value), "");
1043*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((long long)0)), double>::value), "");
1044*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((unsigned long long)0)), double>::value), "");
1045*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((double)0)), double>::value), "");
1046*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgamma((long double)0)), long double>::value), "");
1047*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgammaf(0)), float>::value), "");
1048*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lgammal(0)), long double>::value), "");
1049*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(lgamma(Ambiguous())), Ambiguous>::value), "");
1050*0a6a1f1dSLionel Sambuc assert(std::lgamma(1) == 0);
1051*0a6a1f1dSLionel Sambuc }
1052*0a6a1f1dSLionel Sambuc
test_llrint()1053*0a6a1f1dSLionel Sambuc void test_llrint()
1054*0a6a1f1dSLionel Sambuc {
1055*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((float)0)), long long>::value), "");
1056*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((bool)0)), long long>::value), "");
1057*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((unsigned short)0)), long long>::value), "");
1058*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((int)0)), long long>::value), "");
1059*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((unsigned int)0)), long long>::value), "");
1060*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((long)0)), long long>::value), "");
1061*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((unsigned long)0)), long long>::value), "");
1062*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((long long)0)), long long>::value), "");
1063*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((unsigned long long)0)), long long>::value), "");
1064*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((double)0)), long long>::value), "");
1065*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrint((long double)0)), long long>::value), "");
1066*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrintf(0)), long long>::value), "");
1067*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llrintl(0)), long long>::value), "");
1068*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(llrint(Ambiguous())), Ambiguous>::value), "");
1069*0a6a1f1dSLionel Sambuc assert(std::llrint(1) == 1LL);
1070*0a6a1f1dSLionel Sambuc }
1071*0a6a1f1dSLionel Sambuc
test_llround()1072*0a6a1f1dSLionel Sambuc void test_llround()
1073*0a6a1f1dSLionel Sambuc {
1074*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((float)0)), long long>::value), "");
1075*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((bool)0)), long long>::value), "");
1076*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((unsigned short)0)), long long>::value), "");
1077*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((int)0)), long long>::value), "");
1078*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((unsigned int)0)), long long>::value), "");
1079*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((long)0)), long long>::value), "");
1080*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((unsigned long)0)), long long>::value), "");
1081*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((long long)0)), long long>::value), "");
1082*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((unsigned long long)0)), long long>::value), "");
1083*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((double)0)), long long>::value), "");
1084*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llround((long double)0)), long long>::value), "");
1085*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llroundf(0)), long long>::value), "");
1086*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::llroundl(0)), long long>::value), "");
1087*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(llround(Ambiguous())), Ambiguous>::value), "");
1088*0a6a1f1dSLionel Sambuc assert(std::llround(1) == 1LL);
1089*0a6a1f1dSLionel Sambuc }
1090*0a6a1f1dSLionel Sambuc
test_log1p()1091*0a6a1f1dSLionel Sambuc void test_log1p()
1092*0a6a1f1dSLionel Sambuc {
1093*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((float)0)), float>::value), "");
1094*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((bool)0)), double>::value), "");
1095*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((unsigned short)0)), double>::value), "");
1096*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((int)0)), double>::value), "");
1097*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((unsigned int)0)), double>::value), "");
1098*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((long)0)), double>::value), "");
1099*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((unsigned long)0)), double>::value), "");
1100*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((long long)0)), double>::value), "");
1101*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((unsigned long long)0)), double>::value), "");
1102*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((double)0)), double>::value), "");
1103*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1p((long double)0)), long double>::value), "");
1104*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1pf(0)), float>::value), "");
1105*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log1pl(0)), long double>::value), "");
1106*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(log1p(Ambiguous())), Ambiguous>::value), "");
1107*0a6a1f1dSLionel Sambuc assert(std::log1p(0) == 0);
1108*0a6a1f1dSLionel Sambuc }
1109*0a6a1f1dSLionel Sambuc
test_log2()1110*0a6a1f1dSLionel Sambuc void test_log2()
1111*0a6a1f1dSLionel Sambuc {
1112*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((float)0)), float>::value), "");
1113*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((bool)0)), double>::value), "");
1114*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((unsigned short)0)), double>::value), "");
1115*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((int)0)), double>::value), "");
1116*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((unsigned int)0)), double>::value), "");
1117*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((long)0)), double>::value), "");
1118*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((unsigned long)0)), double>::value), "");
1119*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((long long)0)), double>::value), "");
1120*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((unsigned long long)0)), double>::value), "");
1121*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((double)0)), double>::value), "");
1122*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2((long double)0)), long double>::value), "");
1123*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2f(0)), float>::value), "");
1124*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::log2l(0)), long double>::value), "");
1125*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(log2(Ambiguous())), Ambiguous>::value), "");
1126*0a6a1f1dSLionel Sambuc assert(std::log2(1) == 0);
1127*0a6a1f1dSLionel Sambuc }
1128*0a6a1f1dSLionel Sambuc
test_logb()1129*0a6a1f1dSLionel Sambuc void test_logb()
1130*0a6a1f1dSLionel Sambuc {
1131*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((float)0)), float>::value), "");
1132*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((bool)0)), double>::value), "");
1133*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((unsigned short)0)), double>::value), "");
1134*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((int)0)), double>::value), "");
1135*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((unsigned int)0)), double>::value), "");
1136*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((long)0)), double>::value), "");
1137*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((unsigned long)0)), double>::value), "");
1138*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((long long)0)), double>::value), "");
1139*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((unsigned long long)0)), double>::value), "");
1140*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((double)0)), double>::value), "");
1141*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logb((long double)0)), long double>::value), "");
1142*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logbf(0)), float>::value), "");
1143*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::logbl(0)), long double>::value), "");
1144*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(logb(Ambiguous())), Ambiguous>::value), "");
1145*0a6a1f1dSLionel Sambuc assert(std::logb(1) == 0);
1146*0a6a1f1dSLionel Sambuc }
1147*0a6a1f1dSLionel Sambuc
test_lrint()1148*0a6a1f1dSLionel Sambuc void test_lrint()
1149*0a6a1f1dSLionel Sambuc {
1150*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((float)0)), long>::value), "");
1151*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((bool)0)), long>::value), "");
1152*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((unsigned short)0)), long>::value), "");
1153*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((int)0)), long>::value), "");
1154*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((unsigned int)0)), long>::value), "");
1155*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((long)0)), long>::value), "");
1156*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((unsigned long)0)), long>::value), "");
1157*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((long long)0)), long>::value), "");
1158*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((unsigned long long)0)), long>::value), "");
1159*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((double)0)), long>::value), "");
1160*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrint((long double)0)), long>::value), "");
1161*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrintf(0)), long>::value), "");
1162*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lrintl(0)), long>::value), "");
1163*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(lrint(Ambiguous())), Ambiguous>::value), "");
1164*0a6a1f1dSLionel Sambuc assert(std::lrint(1) == 1L);
1165*0a6a1f1dSLionel Sambuc }
1166*0a6a1f1dSLionel Sambuc
test_lround()1167*0a6a1f1dSLionel Sambuc void test_lround()
1168*0a6a1f1dSLionel Sambuc {
1169*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((float)0)), long>::value), "");
1170*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((bool)0)), long>::value), "");
1171*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((unsigned short)0)), long>::value), "");
1172*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((int)0)), long>::value), "");
1173*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((unsigned int)0)), long>::value), "");
1174*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((long)0)), long>::value), "");
1175*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((unsigned long)0)), long>::value), "");
1176*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((long long)0)), long>::value), "");
1177*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((unsigned long long)0)), long>::value), "");
1178*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((double)0)), long>::value), "");
1179*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lround((long double)0)), long>::value), "");
1180*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lroundf(0)), long>::value), "");
1181*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::lroundl(0)), long>::value), "");
1182*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(lround(Ambiguous())), Ambiguous>::value), "");
1183*0a6a1f1dSLionel Sambuc assert(std::lround(1) == 1L);
1184*0a6a1f1dSLionel Sambuc }
1185*0a6a1f1dSLionel Sambuc
test_nan()1186*0a6a1f1dSLionel Sambuc void test_nan()
1187*0a6a1f1dSLionel Sambuc {
1188*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nan("")), double>::value), "");
1189*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nanf("")), float>::value), "");
1190*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nanl("")), long double>::value), "");
1191*0a6a1f1dSLionel Sambuc }
1192*0a6a1f1dSLionel Sambuc
test_nearbyint()1193*0a6a1f1dSLionel Sambuc void test_nearbyint()
1194*0a6a1f1dSLionel Sambuc {
1195*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((float)0)), float>::value), "");
1196*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((bool)0)), double>::value), "");
1197*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((unsigned short)0)), double>::value), "");
1198*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((int)0)), double>::value), "");
1199*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((unsigned int)0)), double>::value), "");
1200*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((long)0)), double>::value), "");
1201*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((unsigned long)0)), double>::value), "");
1202*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((long long)0)), double>::value), "");
1203*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((unsigned long long)0)), double>::value), "");
1204*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((double)0)), double>::value), "");
1205*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyint((long double)0)), long double>::value), "");
1206*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyintf(0)), float>::value), "");
1207*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nearbyintl(0)), long double>::value), "");
1208*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(nearbyint(Ambiguous())), Ambiguous>::value), "");
1209*0a6a1f1dSLionel Sambuc assert(std::nearbyint(1) == 1);
1210*0a6a1f1dSLionel Sambuc }
1211*0a6a1f1dSLionel Sambuc
test_nextafter()1212*0a6a1f1dSLionel Sambuc void test_nextafter()
1213*0a6a1f1dSLionel Sambuc {
1214*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((float)0, (float)0)), float>::value), "");
1215*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((bool)0, (float)0)), double>::value), "");
1216*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((unsigned short)0, (double)0)), double>::value), "");
1217*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((int)0, (long double)0)), long double>::value), "");
1218*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((float)0, (unsigned int)0)), double>::value), "");
1219*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((double)0, (long)0)), double>::value), "");
1220*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((long double)0, (unsigned long)0)), long double>::value), "");
1221*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((int)0, (long long)0)), double>::value), "");
1222*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((int)0, (unsigned long long)0)), double>::value), "");
1223*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((double)0, (double)0)), double>::value), "");
1224*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((long double)0, (long double)0)), long double>::value), "");
1225*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((float)0, (double)0)), double>::value), "");
1226*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((float)0, (long double)0)), long double>::value), "");
1227*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((double)0, (long double)0)), long double>::value), "");
1228*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafterf(0,0)), float>::value), "");
1229*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafterl(0,0)), long double>::value), "");
1230*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nextafter((int)0, (int)0)), double>::value), "");
1231*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(nextafter(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
1232*0a6a1f1dSLionel Sambuc assert(std::nextafter(0,1) == hexfloat<double>(0x1, 0, -1074));
1233*0a6a1f1dSLionel Sambuc }
1234*0a6a1f1dSLionel Sambuc
test_nexttoward()1235*0a6a1f1dSLionel Sambuc void test_nexttoward()
1236*0a6a1f1dSLionel Sambuc {
1237*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((float)0, (long double)0)), float>::value), "");
1238*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((bool)0, (long double)0)), double>::value), "");
1239*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((unsigned short)0, (long double)0)), double>::value), "");
1240*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((int)0, (long double)0)), double>::value), "");
1241*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((unsigned int)0, (long double)0)), double>::value), "");
1242*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((long)0, (long double)0)), double>::value), "");
1243*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((unsigned long)0, (long double)0)), double>::value), "");
1244*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((long long)0, (long double)0)), double>::value), "");
1245*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((unsigned long long)0, (long double)0)), double>::value), "");
1246*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((double)0, (long double)0)), double>::value), "");
1247*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttoward((long double)0, (long double)0)), long double>::value), "");
1248*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttowardf(0, (long double)0)), float>::value), "");
1249*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::nexttowardl(0, (long double)0)), long double>::value), "");
1250*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(nexttoward(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
1251*0a6a1f1dSLionel Sambuc assert(std::nexttoward(0, 1) == hexfloat<double>(0x1, 0, -1074));
1252*0a6a1f1dSLionel Sambuc }
1253*0a6a1f1dSLionel Sambuc
test_remainder()1254*0a6a1f1dSLionel Sambuc void test_remainder()
1255*0a6a1f1dSLionel Sambuc {
1256*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((float)0, (float)0)), float>::value), "");
1257*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((bool)0, (float)0)), double>::value), "");
1258*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((unsigned short)0, (double)0)), double>::value), "");
1259*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((int)0, (long double)0)), long double>::value), "");
1260*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((float)0, (unsigned int)0)), double>::value), "");
1261*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((double)0, (long)0)), double>::value), "");
1262*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((long double)0, (unsigned long)0)), long double>::value), "");
1263*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((int)0, (long long)0)), double>::value), "");
1264*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((int)0, (unsigned long long)0)), double>::value), "");
1265*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((double)0, (double)0)), double>::value), "");
1266*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((long double)0, (long double)0)), long double>::value), "");
1267*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((float)0, (double)0)), double>::value), "");
1268*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((float)0, (long double)0)), long double>::value), "");
1269*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((double)0, (long double)0)), long double>::value), "");
1270*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainderf(0,0)), float>::value), "");
1271*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainderl(0,0)), long double>::value), "");
1272*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remainder((int)0, (int)0)), double>::value), "");
1273*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(remainder(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
1274*0a6a1f1dSLionel Sambuc assert(std::remainder(0.5,1) == 0.5);
1275*0a6a1f1dSLionel Sambuc }
1276*0a6a1f1dSLionel Sambuc
test_remquo()1277*0a6a1f1dSLionel Sambuc void test_remquo()
1278*0a6a1f1dSLionel Sambuc {
1279*0a6a1f1dSLionel Sambuc int ip;
1280*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((float)0, (float)0, &ip)), float>::value), "");
1281*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((bool)0, (float)0, &ip)), double>::value), "");
1282*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((unsigned short)0, (double)0, &ip)), double>::value), "");
1283*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((int)0, (long double)0, &ip)), long double>::value), "");
1284*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((float)0, (unsigned int)0, &ip)), double>::value), "");
1285*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((double)0, (long)0, &ip)), double>::value), "");
1286*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((long double)0, (unsigned long)0, &ip)), long double>::value), "");
1287*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((int)0, (long long)0, &ip)), double>::value), "");
1288*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((int)0, (unsigned long long)0, &ip)), double>::value), "");
1289*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((double)0, (double)0, &ip)), double>::value), "");
1290*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((long double)0, (long double)0, &ip)), long double>::value), "");
1291*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((float)0, (double)0, &ip)), double>::value), "");
1292*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((float)0, (long double)0, &ip)), long double>::value), "");
1293*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((double)0, (long double)0, &ip)), long double>::value), "");
1294*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquof(0,0, &ip)), float>::value), "");
1295*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquol(0,0, &ip)), long double>::value), "");
1296*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::remquo((int)0, (int)0, &ip)), double>::value), "");
1297*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(remquo(Ambiguous(), Ambiguous(), &ip)), Ambiguous>::value), "");
1298*0a6a1f1dSLionel Sambuc assert(std::remquo(0.5,1, &ip) == 0.5);
1299*0a6a1f1dSLionel Sambuc }
1300*0a6a1f1dSLionel Sambuc
test_rint()1301*0a6a1f1dSLionel Sambuc void test_rint()
1302*0a6a1f1dSLionel Sambuc {
1303*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((float)0)), float>::value), "");
1304*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((bool)0)), double>::value), "");
1305*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((unsigned short)0)), double>::value), "");
1306*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((int)0)), double>::value), "");
1307*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((unsigned int)0)), double>::value), "");
1308*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((long)0)), double>::value), "");
1309*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((unsigned long)0)), double>::value), "");
1310*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((long long)0)), double>::value), "");
1311*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((unsigned long long)0)), double>::value), "");
1312*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((double)0)), double>::value), "");
1313*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rint((long double)0)), long double>::value), "");
1314*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rintf(0)), float>::value), "");
1315*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::rintl(0)), long double>::value), "");
1316*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(rint(Ambiguous())), Ambiguous>::value), "");
1317*0a6a1f1dSLionel Sambuc assert(std::rint(1) == 1);
1318*0a6a1f1dSLionel Sambuc }
1319*0a6a1f1dSLionel Sambuc
test_round()1320*0a6a1f1dSLionel Sambuc void test_round()
1321*0a6a1f1dSLionel Sambuc {
1322*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((float)0)), float>::value), "");
1323*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((bool)0)), double>::value), "");
1324*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((unsigned short)0)), double>::value), "");
1325*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((int)0)), double>::value), "");
1326*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((unsigned int)0)), double>::value), "");
1327*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((long)0)), double>::value), "");
1328*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((unsigned long)0)), double>::value), "");
1329*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((long long)0)), double>::value), "");
1330*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((unsigned long long)0)), double>::value), "");
1331*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((double)0)), double>::value), "");
1332*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::round((long double)0)), long double>::value), "");
1333*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::roundf(0)), float>::value), "");
1334*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::roundl(0)), long double>::value), "");
1335*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(round(Ambiguous())), Ambiguous>::value), "");
1336*0a6a1f1dSLionel Sambuc assert(std::round(1) == 1);
1337*0a6a1f1dSLionel Sambuc }
1338*0a6a1f1dSLionel Sambuc
test_scalbln()1339*0a6a1f1dSLionel Sambuc void test_scalbln()
1340*0a6a1f1dSLionel Sambuc {
1341*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((float)0, (long)0)), float>::value), "");
1342*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((bool)0, (long)0)), double>::value), "");
1343*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((unsigned short)0, (long)0)), double>::value), "");
1344*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((int)0, (long)0)), double>::value), "");
1345*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((unsigned int)0, (long)0)), double>::value), "");
1346*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((long)0, (long)0)), double>::value), "");
1347*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((unsigned long)0, (long)0)), double>::value), "");
1348*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((long long)0, (long)0)), double>::value), "");
1349*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((unsigned long long)0, (long)0)), double>::value), "");
1350*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((double)0, (long)0)), double>::value), "");
1351*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbln((long double)0, (long)0)), long double>::value), "");
1352*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalblnf(0, (long)0)), float>::value), "");
1353*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalblnl(0, (long)0)), long double>::value), "");
1354*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(scalbln(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
1355*0a6a1f1dSLionel Sambuc assert(std::scalbln(1, 1) == 2);
1356*0a6a1f1dSLionel Sambuc }
1357*0a6a1f1dSLionel Sambuc
test_scalbn()1358*0a6a1f1dSLionel Sambuc void test_scalbn()
1359*0a6a1f1dSLionel Sambuc {
1360*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((float)0, (int)0)), float>::value), "");
1361*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((bool)0, (int)0)), double>::value), "");
1362*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((unsigned short)0, (int)0)), double>::value), "");
1363*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((int)0, (int)0)), double>::value), "");
1364*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((unsigned int)0, (int)0)), double>::value), "");
1365*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((long)0, (int)0)), double>::value), "");
1366*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((unsigned long)0, (int)0)), double>::value), "");
1367*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((long long)0, (int)0)), double>::value), "");
1368*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((unsigned long long)0, (int)0)), double>::value), "");
1369*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((double)0, (int)0)), double>::value), "");
1370*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbn((long double)0, (int)0)), long double>::value), "");
1371*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbnf(0, (int)0)), float>::value), "");
1372*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::scalbnl(0, (int)0)), long double>::value), "");
1373*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(scalbn(Ambiguous(), Ambiguous())), Ambiguous>::value), "");
1374*0a6a1f1dSLionel Sambuc assert(std::scalbn(1, 1) == 2);
1375*0a6a1f1dSLionel Sambuc }
1376*0a6a1f1dSLionel Sambuc
test_tgamma()1377*0a6a1f1dSLionel Sambuc void test_tgamma()
1378*0a6a1f1dSLionel Sambuc {
1379*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((float)0)), float>::value), "");
1380*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((bool)0)), double>::value), "");
1381*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((unsigned short)0)), double>::value), "");
1382*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((int)0)), double>::value), "");
1383*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((unsigned int)0)), double>::value), "");
1384*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((long)0)), double>::value), "");
1385*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((unsigned long)0)), double>::value), "");
1386*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((long long)0)), double>::value), "");
1387*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((unsigned long long)0)), double>::value), "");
1388*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((double)0)), double>::value), "");
1389*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgamma((long double)0)), long double>::value), "");
1390*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgammaf(0)), float>::value), "");
1391*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::tgammal(0)), long double>::value), "");
1392*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(tgamma(Ambiguous())), Ambiguous>::value), "");
1393*0a6a1f1dSLionel Sambuc assert(std::tgamma(1) == 1);
1394*0a6a1f1dSLionel Sambuc }
1395*0a6a1f1dSLionel Sambuc
test_trunc()1396*0a6a1f1dSLionel Sambuc void test_trunc()
1397*0a6a1f1dSLionel Sambuc {
1398*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((float)0)), float>::value), "");
1399*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((bool)0)), double>::value), "");
1400*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((unsigned short)0)), double>::value), "");
1401*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((int)0)), double>::value), "");
1402*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((unsigned int)0)), double>::value), "");
1403*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((long)0)), double>::value), "");
1404*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((unsigned long)0)), double>::value), "");
1405*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((long long)0)), double>::value), "");
1406*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((unsigned long long)0)), double>::value), "");
1407*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((double)0)), double>::value), "");
1408*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::trunc((long double)0)), long double>::value), "");
1409*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::truncf(0)), float>::value), "");
1410*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(std::truncl(0)), long double>::value), "");
1411*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(trunc(Ambiguous())), Ambiguous>::value), "");
1412*0a6a1f1dSLionel Sambuc assert(std::trunc(1) == 1);
1413*0a6a1f1dSLionel Sambuc }
1414*0a6a1f1dSLionel Sambuc
main()1415*0a6a1f1dSLionel Sambuc int main()
1416*0a6a1f1dSLionel Sambuc {
1417*0a6a1f1dSLionel Sambuc test_abs();
1418*0a6a1f1dSLionel Sambuc test_acos();
1419*0a6a1f1dSLionel Sambuc test_asin();
1420*0a6a1f1dSLionel Sambuc test_atan();
1421*0a6a1f1dSLionel Sambuc test_atan2();
1422*0a6a1f1dSLionel Sambuc test_ceil();
1423*0a6a1f1dSLionel Sambuc test_cos();
1424*0a6a1f1dSLionel Sambuc test_cosh();
1425*0a6a1f1dSLionel Sambuc test_exp();
1426*0a6a1f1dSLionel Sambuc test_fabs();
1427*0a6a1f1dSLionel Sambuc test_floor();
1428*0a6a1f1dSLionel Sambuc test_fmod();
1429*0a6a1f1dSLionel Sambuc test_frexp();
1430*0a6a1f1dSLionel Sambuc test_ldexp();
1431*0a6a1f1dSLionel Sambuc test_log();
1432*0a6a1f1dSLionel Sambuc test_log10();
1433*0a6a1f1dSLionel Sambuc test_modf();
1434*0a6a1f1dSLionel Sambuc test_pow();
1435*0a6a1f1dSLionel Sambuc test_sin();
1436*0a6a1f1dSLionel Sambuc test_sinh();
1437*0a6a1f1dSLionel Sambuc test_sqrt();
1438*0a6a1f1dSLionel Sambuc test_tan();
1439*0a6a1f1dSLionel Sambuc test_tanh();
1440*0a6a1f1dSLionel Sambuc test_signbit();
1441*0a6a1f1dSLionel Sambuc test_fpclassify();
1442*0a6a1f1dSLionel Sambuc test_isfinite();
1443*0a6a1f1dSLionel Sambuc test_isnormal();
1444*0a6a1f1dSLionel Sambuc test_isgreater();
1445*0a6a1f1dSLionel Sambuc test_isgreaterequal();
1446*0a6a1f1dSLionel Sambuc test_isless();
1447*0a6a1f1dSLionel Sambuc test_islessequal();
1448*0a6a1f1dSLionel Sambuc test_islessgreater();
1449*0a6a1f1dSLionel Sambuc test_isunordered();
1450*0a6a1f1dSLionel Sambuc test_acosh();
1451*0a6a1f1dSLionel Sambuc test_asinh();
1452*0a6a1f1dSLionel Sambuc test_atanh();
1453*0a6a1f1dSLionel Sambuc test_cbrt();
1454*0a6a1f1dSLionel Sambuc test_copysign();
1455*0a6a1f1dSLionel Sambuc test_erf();
1456*0a6a1f1dSLionel Sambuc test_erfc();
1457*0a6a1f1dSLionel Sambuc test_exp2();
1458*0a6a1f1dSLionel Sambuc test_expm1();
1459*0a6a1f1dSLionel Sambuc test_fdim();
1460*0a6a1f1dSLionel Sambuc test_fma();
1461*0a6a1f1dSLionel Sambuc test_fmax();
1462*0a6a1f1dSLionel Sambuc test_fmin();
1463*0a6a1f1dSLionel Sambuc test_hypot();
1464*0a6a1f1dSLionel Sambuc test_ilogb();
1465*0a6a1f1dSLionel Sambuc test_lgamma();
1466*0a6a1f1dSLionel Sambuc test_llrint();
1467*0a6a1f1dSLionel Sambuc test_llround();
1468*0a6a1f1dSLionel Sambuc test_log1p();
1469*0a6a1f1dSLionel Sambuc test_log2();
1470*0a6a1f1dSLionel Sambuc test_logb();
1471*0a6a1f1dSLionel Sambuc test_lrint();
1472*0a6a1f1dSLionel Sambuc test_lround();
1473*0a6a1f1dSLionel Sambuc test_nan();
1474*0a6a1f1dSLionel Sambuc test_nearbyint();
1475*0a6a1f1dSLionel Sambuc test_nextafter();
1476*0a6a1f1dSLionel Sambuc test_nexttoward();
1477*0a6a1f1dSLionel Sambuc test_remainder();
1478*0a6a1f1dSLionel Sambuc test_remquo();
1479*0a6a1f1dSLionel Sambuc test_rint();
1480*0a6a1f1dSLionel Sambuc test_round();
1481*0a6a1f1dSLionel Sambuc test_scalbln();
1482*0a6a1f1dSLionel Sambuc test_scalbn();
1483*0a6a1f1dSLionel Sambuc test_tgamma();
1484*0a6a1f1dSLionel Sambuc test_trunc();
1485*0a6a1f1dSLionel Sambuc }
1486