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