14684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
24684ddb6SLionel Sambuc //
34684ddb6SLionel Sambuc // The LLVM Compiler Infrastructure
44684ddb6SLionel Sambuc //
54684ddb6SLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
64684ddb6SLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
74684ddb6SLionel Sambuc //
84684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
94684ddb6SLionel Sambuc
104684ddb6SLionel Sambuc // <math.h>
114684ddb6SLionel Sambuc
12*0a6a1f1dSLionel Sambuc // XFAIL: linux
13*0a6a1f1dSLionel Sambuc
144684ddb6SLionel Sambuc #include <math.h>
154684ddb6SLionel Sambuc #include <type_traits>
164684ddb6SLionel Sambuc #include <cassert>
174684ddb6SLionel Sambuc
184684ddb6SLionel Sambuc #include "hexfloat.h"
194684ddb6SLionel Sambuc
test_acos()204684ddb6SLionel Sambuc void test_acos()
214684ddb6SLionel Sambuc {
224684ddb6SLionel Sambuc static_assert((std::is_same<decltype(acos((double)0)), double>::value), "");
234684ddb6SLionel Sambuc static_assert((std::is_same<decltype(acosf(0)), float>::value), "");
244684ddb6SLionel Sambuc static_assert((std::is_same<decltype(acosl(0)), long double>::value), "");
254684ddb6SLionel Sambuc assert(acos(1) == 0);
264684ddb6SLionel Sambuc }
274684ddb6SLionel Sambuc
test_asin()284684ddb6SLionel Sambuc void test_asin()
294684ddb6SLionel Sambuc {
304684ddb6SLionel Sambuc static_assert((std::is_same<decltype(asin((double)0)), double>::value), "");
314684ddb6SLionel Sambuc static_assert((std::is_same<decltype(asinf(0)), float>::value), "");
324684ddb6SLionel Sambuc static_assert((std::is_same<decltype(asinl(0)), long double>::value), "");
334684ddb6SLionel Sambuc assert(asin(0) == 0);
344684ddb6SLionel Sambuc }
354684ddb6SLionel Sambuc
test_atan()364684ddb6SLionel Sambuc void test_atan()
374684ddb6SLionel Sambuc {
384684ddb6SLionel Sambuc static_assert((std::is_same<decltype(atan((double)0)), double>::value), "");
394684ddb6SLionel Sambuc static_assert((std::is_same<decltype(atanf(0)), float>::value), "");
404684ddb6SLionel Sambuc static_assert((std::is_same<decltype(atanl(0)), long double>::value), "");
414684ddb6SLionel Sambuc assert(atan(0) == 0);
424684ddb6SLionel Sambuc }
434684ddb6SLionel Sambuc
test_atan2()444684ddb6SLionel Sambuc void test_atan2()
454684ddb6SLionel Sambuc {
464684ddb6SLionel Sambuc static_assert((std::is_same<decltype(atan2((double)0, (double)0)), double>::value), "");
474684ddb6SLionel Sambuc static_assert((std::is_same<decltype(atan2f(0,0)), float>::value), "");
484684ddb6SLionel Sambuc static_assert((std::is_same<decltype(atan2l(0,0)), long double>::value), "");
494684ddb6SLionel Sambuc assert(atan2(0,1) == 0);
504684ddb6SLionel Sambuc }
514684ddb6SLionel Sambuc
test_ceil()524684ddb6SLionel Sambuc void test_ceil()
534684ddb6SLionel Sambuc {
544684ddb6SLionel Sambuc static_assert((std::is_same<decltype(ceil((double)0)), double>::value), "");
554684ddb6SLionel Sambuc static_assert((std::is_same<decltype(ceilf(0)), float>::value), "");
564684ddb6SLionel Sambuc static_assert((std::is_same<decltype(ceill(0)), long double>::value), "");
574684ddb6SLionel Sambuc assert(ceil(0) == 0);
584684ddb6SLionel Sambuc }
594684ddb6SLionel Sambuc
test_cos()604684ddb6SLionel Sambuc void test_cos()
614684ddb6SLionel Sambuc {
624684ddb6SLionel Sambuc static_assert((std::is_same<decltype(cos((double)0)), double>::value), "");
634684ddb6SLionel Sambuc static_assert((std::is_same<decltype(cosf(0)), float>::value), "");
644684ddb6SLionel Sambuc static_assert((std::is_same<decltype(cosl(0)), long double>::value), "");
654684ddb6SLionel Sambuc assert(cos(0) == 1);
664684ddb6SLionel Sambuc }
674684ddb6SLionel Sambuc
test_cosh()684684ddb6SLionel Sambuc void test_cosh()
694684ddb6SLionel Sambuc {
704684ddb6SLionel Sambuc static_assert((std::is_same<decltype(cosh((double)0)), double>::value), "");
714684ddb6SLionel Sambuc static_assert((std::is_same<decltype(coshf(0)), float>::value), "");
724684ddb6SLionel Sambuc static_assert((std::is_same<decltype(coshl(0)), long double>::value), "");
734684ddb6SLionel Sambuc assert(cosh(0) == 1);
744684ddb6SLionel Sambuc }
754684ddb6SLionel Sambuc
test_exp()764684ddb6SLionel Sambuc void test_exp()
774684ddb6SLionel Sambuc {
784684ddb6SLionel Sambuc static_assert((std::is_same<decltype(exp((double)0)), double>::value), "");
794684ddb6SLionel Sambuc static_assert((std::is_same<decltype(expf(0)), float>::value), "");
804684ddb6SLionel Sambuc static_assert((std::is_same<decltype(expl(0)), long double>::value), "");
814684ddb6SLionel Sambuc assert(exp(0) == 1);
824684ddb6SLionel Sambuc }
834684ddb6SLionel Sambuc
test_fabs()844684ddb6SLionel Sambuc void test_fabs()
854684ddb6SLionel Sambuc {
864684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fabs((double)0)), double>::value), "");
87*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(fabsf(0.f)), float>::value), "");
88*0a6a1f1dSLionel Sambuc static_assert((std::is_same<decltype(fabsl(0.L)), long double>::value), "");
89*0a6a1f1dSLionel Sambuc assert(fabs(-1.f) == 1);
904684ddb6SLionel Sambuc }
914684ddb6SLionel Sambuc
test_floor()924684ddb6SLionel Sambuc void test_floor()
934684ddb6SLionel Sambuc {
944684ddb6SLionel Sambuc static_assert((std::is_same<decltype(floor((double)0)), double>::value), "");
954684ddb6SLionel Sambuc static_assert((std::is_same<decltype(floorf(0)), float>::value), "");
964684ddb6SLionel Sambuc static_assert((std::is_same<decltype(floorl(0)), long double>::value), "");
974684ddb6SLionel Sambuc assert(floor(1) == 1);
984684ddb6SLionel Sambuc }
994684ddb6SLionel Sambuc
test_fmod()1004684ddb6SLionel Sambuc void test_fmod()
1014684ddb6SLionel Sambuc {
1024684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fmod((double)0, (double)0)), double>::value), "");
1034684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fmodf(0,0)), float>::value), "");
1044684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fmodl(0,0)), long double>::value), "");
1054684ddb6SLionel Sambuc assert(fmod(1.5,1) == .5);
1064684ddb6SLionel Sambuc }
1074684ddb6SLionel Sambuc
test_frexp()1084684ddb6SLionel Sambuc void test_frexp()
1094684ddb6SLionel Sambuc {
1104684ddb6SLionel Sambuc int ip;
1114684ddb6SLionel Sambuc static_assert((std::is_same<decltype(frexp((double)0, &ip)), double>::value), "");
1124684ddb6SLionel Sambuc static_assert((std::is_same<decltype(frexpf(0, &ip)), float>::value), "");
1134684ddb6SLionel Sambuc static_assert((std::is_same<decltype(frexpl(0, &ip)), long double>::value), "");
1144684ddb6SLionel Sambuc assert(frexp(0, &ip) == 0);
1154684ddb6SLionel Sambuc }
1164684ddb6SLionel Sambuc
test_ldexp()1174684ddb6SLionel Sambuc void test_ldexp()
1184684ddb6SLionel Sambuc {
1194684ddb6SLionel Sambuc int ip = 1;
1204684ddb6SLionel Sambuc static_assert((std::is_same<decltype(ldexp((double)0, ip)), double>::value), "");
1214684ddb6SLionel Sambuc static_assert((std::is_same<decltype(ldexpf(0, ip)), float>::value), "");
1224684ddb6SLionel Sambuc static_assert((std::is_same<decltype(ldexpl(0, ip)), long double>::value), "");
1234684ddb6SLionel Sambuc assert(ldexp(1, ip) == 2);
1244684ddb6SLionel Sambuc }
1254684ddb6SLionel Sambuc
test_log()1264684ddb6SLionel Sambuc void test_log()
1274684ddb6SLionel Sambuc {
1284684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log((double)0)), double>::value), "");
1294684ddb6SLionel Sambuc static_assert((std::is_same<decltype(logf(0)), float>::value), "");
1304684ddb6SLionel Sambuc static_assert((std::is_same<decltype(logl(0)), long double>::value), "");
1314684ddb6SLionel Sambuc assert(log(1) == 0);
1324684ddb6SLionel Sambuc }
1334684ddb6SLionel Sambuc
test_log10()1344684ddb6SLionel Sambuc void test_log10()
1354684ddb6SLionel Sambuc {
1364684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log10((double)0)), double>::value), "");
1374684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log10f(0)), float>::value), "");
1384684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log10l(0)), long double>::value), "");
1394684ddb6SLionel Sambuc assert(log10(1) == 0);
1404684ddb6SLionel Sambuc }
1414684ddb6SLionel Sambuc
test_modf()1424684ddb6SLionel Sambuc void test_modf()
1434684ddb6SLionel Sambuc {
1444684ddb6SLionel Sambuc static_assert((std::is_same<decltype(modf((double)0, (double*)0)), double>::value), "");
1454684ddb6SLionel Sambuc static_assert((std::is_same<decltype(modff(0, (float*)0)), float>::value), "");
1464684ddb6SLionel Sambuc static_assert((std::is_same<decltype(modfl(0, (long double*)0)), long double>::value), "");
1474684ddb6SLionel Sambuc double i;
1484684ddb6SLionel Sambuc assert(modf(1., &i) == 0);
1494684ddb6SLionel Sambuc }
1504684ddb6SLionel Sambuc
test_pow()1514684ddb6SLionel Sambuc void test_pow()
1524684ddb6SLionel Sambuc {
1534684ddb6SLionel Sambuc static_assert((std::is_same<decltype(pow((double)0, (double)0)), double>::value), "");
1544684ddb6SLionel Sambuc static_assert((std::is_same<decltype(powf(0,0)), float>::value), "");
1554684ddb6SLionel Sambuc static_assert((std::is_same<decltype(powl(0,0)), long double>::value), "");
1564684ddb6SLionel Sambuc assert(pow(1,1) == 1);
1574684ddb6SLionel Sambuc }
1584684ddb6SLionel Sambuc
test_sin()1594684ddb6SLionel Sambuc void test_sin()
1604684ddb6SLionel Sambuc {
1614684ddb6SLionel Sambuc static_assert((std::is_same<decltype(sin((double)0)), double>::value), "");
1624684ddb6SLionel Sambuc static_assert((std::is_same<decltype(sinf(0)), float>::value), "");
1634684ddb6SLionel Sambuc static_assert((std::is_same<decltype(sinl(0)), long double>::value), "");
1644684ddb6SLionel Sambuc assert(sin(0) == 0);
1654684ddb6SLionel Sambuc }
1664684ddb6SLionel Sambuc
test_sinh()1674684ddb6SLionel Sambuc void test_sinh()
1684684ddb6SLionel Sambuc {
1694684ddb6SLionel Sambuc static_assert((std::is_same<decltype(sinh((double)0)), double>::value), "");
1704684ddb6SLionel Sambuc static_assert((std::is_same<decltype(sinhf(0)), float>::value), "");
1714684ddb6SLionel Sambuc static_assert((std::is_same<decltype(sinhl(0)), long double>::value), "");
1724684ddb6SLionel Sambuc assert(sinh(0) == 0);
1734684ddb6SLionel Sambuc }
1744684ddb6SLionel Sambuc
test_sqrt()1754684ddb6SLionel Sambuc void test_sqrt()
1764684ddb6SLionel Sambuc {
1774684ddb6SLionel Sambuc static_assert((std::is_same<decltype(sqrt((double)0)), double>::value), "");
1784684ddb6SLionel Sambuc static_assert((std::is_same<decltype(sqrtf(0)), float>::value), "");
1794684ddb6SLionel Sambuc static_assert((std::is_same<decltype(sqrtl(0)), long double>::value), "");
1804684ddb6SLionel Sambuc assert(sqrt(4) == 2);
1814684ddb6SLionel Sambuc }
1824684ddb6SLionel Sambuc
test_tan()1834684ddb6SLionel Sambuc void test_tan()
1844684ddb6SLionel Sambuc {
1854684ddb6SLionel Sambuc static_assert((std::is_same<decltype(tan((double)0)), double>::value), "");
1864684ddb6SLionel Sambuc static_assert((std::is_same<decltype(tanf(0)), float>::value), "");
1874684ddb6SLionel Sambuc static_assert((std::is_same<decltype(tanl(0)), long double>::value), "");
1884684ddb6SLionel Sambuc assert(tan(0) == 0);
1894684ddb6SLionel Sambuc }
1904684ddb6SLionel Sambuc
test_tanh()1914684ddb6SLionel Sambuc void test_tanh()
1924684ddb6SLionel Sambuc {
1934684ddb6SLionel Sambuc static_assert((std::is_same<decltype(tanh((double)0)), double>::value), "");
1944684ddb6SLionel Sambuc static_assert((std::is_same<decltype(tanhf(0)), float>::value), "");
1954684ddb6SLionel Sambuc static_assert((std::is_same<decltype(tanhl(0)), long double>::value), "");
1964684ddb6SLionel Sambuc assert(tanh(0) == 0);
1974684ddb6SLionel Sambuc }
1984684ddb6SLionel Sambuc
test_signbit()1994684ddb6SLionel Sambuc void test_signbit()
2004684ddb6SLionel Sambuc {
2014684ddb6SLionel Sambuc static_assert((std::is_same<decltype(signbit((float)0)), bool>::value), "");
2024684ddb6SLionel Sambuc static_assert((std::is_same<decltype(signbit((double)0)), bool>::value), "");
2034684ddb6SLionel Sambuc static_assert((std::is_same<decltype(signbit((long double)0)), bool>::value), "");
2044684ddb6SLionel Sambuc assert(signbit(-1.0) == true);
2054684ddb6SLionel Sambuc }
2064684ddb6SLionel Sambuc
test_fpclassify()2074684ddb6SLionel Sambuc void test_fpclassify()
2084684ddb6SLionel Sambuc {
2094684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fpclassify((float)0)), int>::value), "");
2104684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fpclassify((double)0)), int>::value), "");
2114684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fpclassify((long double)0)), int>::value), "");
2124684ddb6SLionel Sambuc assert(fpclassify(-1.0) == FP_NORMAL);
2134684ddb6SLionel Sambuc }
2144684ddb6SLionel Sambuc
test_isfinite()2154684ddb6SLionel Sambuc void test_isfinite()
2164684ddb6SLionel Sambuc {
2174684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isfinite((float)0)), bool>::value), "");
2184684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isfinite((double)0)), bool>::value), "");
2194684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isfinite((long double)0)), bool>::value), "");
2204684ddb6SLionel Sambuc assert(isfinite(-1.0) == true);
2214684ddb6SLionel Sambuc }
2224684ddb6SLionel Sambuc
test_isinf()2234684ddb6SLionel Sambuc void test_isinf()
2244684ddb6SLionel Sambuc {
2254684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isinf((float)0)), bool>::value), "");
2264684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isinf((double)0)), bool>::value), "");
2274684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isinf((long double)0)), bool>::value), "");
2284684ddb6SLionel Sambuc assert(isinf(-1.0) == false);
2294684ddb6SLionel Sambuc }
2304684ddb6SLionel Sambuc
test_isnan()2314684ddb6SLionel Sambuc void test_isnan()
2324684ddb6SLionel Sambuc {
2334684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isnan((float)0)), bool>::value), "");
2344684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isnan((double)0)), bool>::value), "");
2354684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isnan((long double)0)), bool>::value), "");
2364684ddb6SLionel Sambuc assert(isnan(-1.0) == false);
2374684ddb6SLionel Sambuc }
2384684ddb6SLionel Sambuc
test_isnormal()2394684ddb6SLionel Sambuc void test_isnormal()
2404684ddb6SLionel Sambuc {
2414684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isnormal((float)0)), bool>::value), "");
2424684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isnormal((double)0)), bool>::value), "");
2434684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isnormal((long double)0)), bool>::value), "");
2444684ddb6SLionel Sambuc assert(isnormal(-1.0) == true);
2454684ddb6SLionel Sambuc }
2464684ddb6SLionel Sambuc
test_isgreater()2474684ddb6SLionel Sambuc void test_isgreater()
2484684ddb6SLionel Sambuc {
2494684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreater((float)0, (float)0)), bool>::value), "");
2504684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreater((float)0, (double)0)), bool>::value), "");
2514684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreater((float)0, (long double)0)), bool>::value), "");
2524684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreater((double)0, (float)0)), bool>::value), "");
2534684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreater((double)0, (double)0)), bool>::value), "");
2544684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreater((double)0, (long double)0)), bool>::value), "");
2554684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreater((long double)0, (float)0)), bool>::value), "");
2564684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreater((long double)0, (double)0)), bool>::value), "");
2574684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreater((long double)0, (long double)0)), bool>::value), "");
2584684ddb6SLionel Sambuc assert(isgreater(-1.0, 0.F) == false);
2594684ddb6SLionel Sambuc }
2604684ddb6SLionel Sambuc
test_isgreaterequal()2614684ddb6SLionel Sambuc void test_isgreaterequal()
2624684ddb6SLionel Sambuc {
2634684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal((float)0, (float)0)), bool>::value), "");
2644684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal((float)0, (double)0)), bool>::value), "");
2654684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal((float)0, (long double)0)), bool>::value), "");
2664684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal((double)0, (float)0)), bool>::value), "");
2674684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal((double)0, (double)0)), bool>::value), "");
2684684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal((double)0, (long double)0)), bool>::value), "");
2694684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal((long double)0, (float)0)), bool>::value), "");
2704684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal((long double)0, (double)0)), bool>::value), "");
2714684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isgreaterequal((long double)0, (long double)0)), bool>::value), "");
2724684ddb6SLionel Sambuc assert(isgreaterequal(-1.0, 0.F) == false);
2734684ddb6SLionel Sambuc }
2744684ddb6SLionel Sambuc
test_isless()2754684ddb6SLionel Sambuc void test_isless()
2764684ddb6SLionel Sambuc {
2774684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isless((float)0, (float)0)), bool>::value), "");
2784684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isless((float)0, (double)0)), bool>::value), "");
2794684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isless((float)0, (long double)0)), bool>::value), "");
2804684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isless((double)0, (float)0)), bool>::value), "");
2814684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isless((double)0, (double)0)), bool>::value), "");
2824684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isless((double)0, (long double)0)), bool>::value), "");
2834684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isless((long double)0, (float)0)), bool>::value), "");
2844684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isless((long double)0, (double)0)), bool>::value), "");
2854684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isless((long double)0, (long double)0)), bool>::value), "");
2864684ddb6SLionel Sambuc assert(isless(-1.0, 0.F) == true);
2874684ddb6SLionel Sambuc }
2884684ddb6SLionel Sambuc
test_islessequal()2894684ddb6SLionel Sambuc void test_islessequal()
2904684ddb6SLionel Sambuc {
2914684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessequal((float)0, (float)0)), bool>::value), "");
2924684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessequal((float)0, (double)0)), bool>::value), "");
2934684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessequal((float)0, (long double)0)), bool>::value), "");
2944684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessequal((double)0, (float)0)), bool>::value), "");
2954684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessequal((double)0, (double)0)), bool>::value), "");
2964684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessequal((double)0, (long double)0)), bool>::value), "");
2974684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessequal((long double)0, (float)0)), bool>::value), "");
2984684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessequal((long double)0, (double)0)), bool>::value), "");
2994684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessequal((long double)0, (long double)0)), bool>::value), "");
3004684ddb6SLionel Sambuc assert(islessequal(-1.0, 0.F) == true);
3014684ddb6SLionel Sambuc }
3024684ddb6SLionel Sambuc
test_islessgreater()3034684ddb6SLionel Sambuc void test_islessgreater()
3044684ddb6SLionel Sambuc {
3054684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessgreater((float)0, (float)0)), bool>::value), "");
3064684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessgreater((float)0, (double)0)), bool>::value), "");
3074684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessgreater((float)0, (long double)0)), bool>::value), "");
3084684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessgreater((double)0, (float)0)), bool>::value), "");
3094684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessgreater((double)0, (double)0)), bool>::value), "");
3104684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessgreater((double)0, (long double)0)), bool>::value), "");
3114684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessgreater((long double)0, (float)0)), bool>::value), "");
3124684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessgreater((long double)0, (double)0)), bool>::value), "");
3134684ddb6SLionel Sambuc static_assert((std::is_same<decltype(islessgreater((long double)0, (long double)0)), bool>::value), "");
3144684ddb6SLionel Sambuc assert(islessgreater(-1.0, 0.F) == true);
3154684ddb6SLionel Sambuc }
3164684ddb6SLionel Sambuc
test_isunordered()3174684ddb6SLionel Sambuc void test_isunordered()
3184684ddb6SLionel Sambuc {
3194684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isunordered((float)0, (float)0)), bool>::value), "");
3204684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isunordered((float)0, (double)0)), bool>::value), "");
3214684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isunordered((float)0, (long double)0)), bool>::value), "");
3224684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isunordered((double)0, (float)0)), bool>::value), "");
3234684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isunordered((double)0, (double)0)), bool>::value), "");
3244684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isunordered((double)0, (long double)0)), bool>::value), "");
3254684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isunordered((long double)0, (float)0)), bool>::value), "");
3264684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isunordered((long double)0, (double)0)), bool>::value), "");
3274684ddb6SLionel Sambuc static_assert((std::is_same<decltype(isunordered((long double)0, (long double)0)), bool>::value), "");
3284684ddb6SLionel Sambuc assert(isunordered(-1.0, 0.F) == false);
3294684ddb6SLionel Sambuc }
3304684ddb6SLionel Sambuc
test_acosh()3314684ddb6SLionel Sambuc void test_acosh()
3324684ddb6SLionel Sambuc {
3334684ddb6SLionel Sambuc static_assert((std::is_same<decltype(acosh((double)0)), double>::value), "");
3344684ddb6SLionel Sambuc static_assert((std::is_same<decltype(acoshf(0)), float>::value), "");
3354684ddb6SLionel Sambuc static_assert((std::is_same<decltype(acoshl(0)), long double>::value), "");
3364684ddb6SLionel Sambuc assert(acosh(1) == 0);
3374684ddb6SLionel Sambuc }
3384684ddb6SLionel Sambuc
test_asinh()3394684ddb6SLionel Sambuc void test_asinh()
3404684ddb6SLionel Sambuc {
3414684ddb6SLionel Sambuc static_assert((std::is_same<decltype(asinh((double)0)), double>::value), "");
3424684ddb6SLionel Sambuc static_assert((std::is_same<decltype(asinhf(0)), float>::value), "");
3434684ddb6SLionel Sambuc static_assert((std::is_same<decltype(asinhl(0)), long double>::value), "");
3444684ddb6SLionel Sambuc assert(asinh(0) == 0);
3454684ddb6SLionel Sambuc }
3464684ddb6SLionel Sambuc
test_atanh()3474684ddb6SLionel Sambuc void test_atanh()
3484684ddb6SLionel Sambuc {
3494684ddb6SLionel Sambuc static_assert((std::is_same<decltype(atanh((double)0)), double>::value), "");
3504684ddb6SLionel Sambuc static_assert((std::is_same<decltype(atanhf(0)), float>::value), "");
3514684ddb6SLionel Sambuc static_assert((std::is_same<decltype(atanhl(0)), long double>::value), "");
3524684ddb6SLionel Sambuc assert(atanh(0) == 0);
3534684ddb6SLionel Sambuc }
3544684ddb6SLionel Sambuc
test_cbrt()3554684ddb6SLionel Sambuc void test_cbrt()
3564684ddb6SLionel Sambuc {
3574684ddb6SLionel Sambuc static_assert((std::is_same<decltype(cbrt((double)0)), double>::value), "");
3584684ddb6SLionel Sambuc static_assert((std::is_same<decltype(cbrtf(0)), float>::value), "");
3594684ddb6SLionel Sambuc static_assert((std::is_same<decltype(cbrtl(0)), long double>::value), "");
3604684ddb6SLionel Sambuc assert(cbrt(1) == 1);
3614684ddb6SLionel Sambuc }
3624684ddb6SLionel Sambuc
test_copysign()3634684ddb6SLionel Sambuc void test_copysign()
3644684ddb6SLionel Sambuc {
3654684ddb6SLionel Sambuc static_assert((std::is_same<decltype(copysign((double)0, (double)0)), double>::value), "");
3664684ddb6SLionel Sambuc static_assert((std::is_same<decltype(copysignf(0,0)), float>::value), "");
3674684ddb6SLionel Sambuc static_assert((std::is_same<decltype(copysignl(0,0)), long double>::value), "");
3684684ddb6SLionel Sambuc assert(copysign(1,1) == 1);
3694684ddb6SLionel Sambuc }
3704684ddb6SLionel Sambuc
test_erf()3714684ddb6SLionel Sambuc void test_erf()
3724684ddb6SLionel Sambuc {
3734684ddb6SLionel Sambuc static_assert((std::is_same<decltype(erf((double)0)), double>::value), "");
3744684ddb6SLionel Sambuc static_assert((std::is_same<decltype(erff(0)), float>::value), "");
3754684ddb6SLionel Sambuc static_assert((std::is_same<decltype(erfl(0)), long double>::value), "");
3764684ddb6SLionel Sambuc assert(erf(0) == 0);
3774684ddb6SLionel Sambuc }
3784684ddb6SLionel Sambuc
test_erfc()3794684ddb6SLionel Sambuc void test_erfc()
3804684ddb6SLionel Sambuc {
3814684ddb6SLionel Sambuc static_assert((std::is_same<decltype(erfc((double)0)), double>::value), "");
3824684ddb6SLionel Sambuc static_assert((std::is_same<decltype(erfcf(0)), float>::value), "");
3834684ddb6SLionel Sambuc static_assert((std::is_same<decltype(erfcl(0)), long double>::value), "");
3844684ddb6SLionel Sambuc assert(erfc(0) == 1);
3854684ddb6SLionel Sambuc }
3864684ddb6SLionel Sambuc
test_exp2()3874684ddb6SLionel Sambuc void test_exp2()
3884684ddb6SLionel Sambuc {
3894684ddb6SLionel Sambuc static_assert((std::is_same<decltype(exp2((double)0)), double>::value), "");
3904684ddb6SLionel Sambuc static_assert((std::is_same<decltype(exp2f(0)), float>::value), "");
3914684ddb6SLionel Sambuc static_assert((std::is_same<decltype(exp2l(0)), long double>::value), "");
3924684ddb6SLionel Sambuc assert(exp2(1) == 2);
3934684ddb6SLionel Sambuc }
3944684ddb6SLionel Sambuc
test_expm1()3954684ddb6SLionel Sambuc void test_expm1()
3964684ddb6SLionel Sambuc {
3974684ddb6SLionel Sambuc static_assert((std::is_same<decltype(expm1((double)0)), double>::value), "");
3984684ddb6SLionel Sambuc static_assert((std::is_same<decltype(expm1f(0)), float>::value), "");
3994684ddb6SLionel Sambuc static_assert((std::is_same<decltype(expm1l(0)), long double>::value), "");
4004684ddb6SLionel Sambuc assert(expm1(0) == 0);
4014684ddb6SLionel Sambuc }
4024684ddb6SLionel Sambuc
test_fdim()4034684ddb6SLionel Sambuc void test_fdim()
4044684ddb6SLionel Sambuc {
4054684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fdim((double)0, (double)0)), double>::value), "");
4064684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fdimf(0,0)), float>::value), "");
4074684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fdiml(0,0)), long double>::value), "");
4084684ddb6SLionel Sambuc assert(fdim(1,0) == 1);
4094684ddb6SLionel Sambuc }
4104684ddb6SLionel Sambuc
test_fma()4114684ddb6SLionel Sambuc void test_fma()
4124684ddb6SLionel Sambuc {
4134684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fma((double)0, (double)0, (double)0)), double>::value), "");
4144684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fmaf(0,0,0)), float>::value), "");
4154684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fmal(0,0,0)), long double>::value), "");
4164684ddb6SLionel Sambuc assert(fma(1,1,1) == 2);
4174684ddb6SLionel Sambuc }
4184684ddb6SLionel Sambuc
test_fmax()4194684ddb6SLionel Sambuc void test_fmax()
4204684ddb6SLionel Sambuc {
4214684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fmax((double)0, (double)0)), double>::value), "");
4224684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fmaxf(0,0)), float>::value), "");
4234684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fmaxl(0,0)), long double>::value), "");
4244684ddb6SLionel Sambuc assert(fmax(1,0) == 1);
4254684ddb6SLionel Sambuc }
4264684ddb6SLionel Sambuc
test_fmin()4274684ddb6SLionel Sambuc void test_fmin()
4284684ddb6SLionel Sambuc {
4294684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fmin((double)0, (double)0)), double>::value), "");
4304684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fminf(0,0)), float>::value), "");
4314684ddb6SLionel Sambuc static_assert((std::is_same<decltype(fminl(0,0)), long double>::value), "");
4324684ddb6SLionel Sambuc assert(fmin(1,0) == 0);
4334684ddb6SLionel Sambuc }
4344684ddb6SLionel Sambuc
test_hypot()4354684ddb6SLionel Sambuc void test_hypot()
4364684ddb6SLionel Sambuc {
4374684ddb6SLionel Sambuc static_assert((std::is_same<decltype(hypot((double)0, (double)0)), double>::value), "");
4384684ddb6SLionel Sambuc static_assert((std::is_same<decltype(hypotf(0,0)), float>::value), "");
4394684ddb6SLionel Sambuc static_assert((std::is_same<decltype(hypotl(0,0)), long double>::value), "");
4404684ddb6SLionel Sambuc assert(hypot(3,4) == 5);
4414684ddb6SLionel Sambuc }
4424684ddb6SLionel Sambuc
test_ilogb()4434684ddb6SLionel Sambuc void test_ilogb()
4444684ddb6SLionel Sambuc {
4454684ddb6SLionel Sambuc static_assert((std::is_same<decltype(ilogb((double)0)), int>::value), "");
4464684ddb6SLionel Sambuc static_assert((std::is_same<decltype(ilogbf(0)), int>::value), "");
4474684ddb6SLionel Sambuc static_assert((std::is_same<decltype(ilogbl(0)), int>::value), "");
4484684ddb6SLionel Sambuc assert(ilogb(1) == 0);
4494684ddb6SLionel Sambuc }
4504684ddb6SLionel Sambuc
test_lgamma()4514684ddb6SLionel Sambuc void test_lgamma()
4524684ddb6SLionel Sambuc {
4534684ddb6SLionel Sambuc static_assert((std::is_same<decltype(lgamma((double)0)), double>::value), "");
4544684ddb6SLionel Sambuc static_assert((std::is_same<decltype(lgammaf(0)), float>::value), "");
4554684ddb6SLionel Sambuc static_assert((std::is_same<decltype(lgammal(0)), long double>::value), "");
4564684ddb6SLionel Sambuc assert(lgamma(1) == 0);
4574684ddb6SLionel Sambuc }
4584684ddb6SLionel Sambuc
test_llrint()4594684ddb6SLionel Sambuc void test_llrint()
4604684ddb6SLionel Sambuc {
4614684ddb6SLionel Sambuc static_assert((std::is_same<decltype(llrint((double)0)), long long>::value), "");
4624684ddb6SLionel Sambuc static_assert((std::is_same<decltype(llrintf(0)), long long>::value), "");
4634684ddb6SLionel Sambuc static_assert((std::is_same<decltype(llrintl(0)), long long>::value), "");
4644684ddb6SLionel Sambuc assert(llrint(1) == 1LL);
4654684ddb6SLionel Sambuc }
4664684ddb6SLionel Sambuc
test_llround()4674684ddb6SLionel Sambuc void test_llround()
4684684ddb6SLionel Sambuc {
4694684ddb6SLionel Sambuc static_assert((std::is_same<decltype(llround((double)0)), long long>::value), "");
4704684ddb6SLionel Sambuc static_assert((std::is_same<decltype(llroundf(0)), long long>::value), "");
4714684ddb6SLionel Sambuc static_assert((std::is_same<decltype(llroundl(0)), long long>::value), "");
4724684ddb6SLionel Sambuc assert(llround(1) == 1LL);
4734684ddb6SLionel Sambuc }
4744684ddb6SLionel Sambuc
test_log1p()4754684ddb6SLionel Sambuc void test_log1p()
4764684ddb6SLionel Sambuc {
4774684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log1p((double)0)), double>::value), "");
4784684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log1pf(0)), float>::value), "");
4794684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log1pl(0)), long double>::value), "");
4804684ddb6SLionel Sambuc assert(log1p(0) == 0);
4814684ddb6SLionel Sambuc }
4824684ddb6SLionel Sambuc
test_log2()4834684ddb6SLionel Sambuc void test_log2()
4844684ddb6SLionel Sambuc {
4854684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log2((double)0)), double>::value), "");
4864684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log2f(0)), float>::value), "");
4874684ddb6SLionel Sambuc static_assert((std::is_same<decltype(log2l(0)), long double>::value), "");
4884684ddb6SLionel Sambuc assert(log2(1) == 0);
4894684ddb6SLionel Sambuc }
4904684ddb6SLionel Sambuc
test_logb()4914684ddb6SLionel Sambuc void test_logb()
4924684ddb6SLionel Sambuc {
4934684ddb6SLionel Sambuc static_assert((std::is_same<decltype(logb((double)0)), double>::value), "");
4944684ddb6SLionel Sambuc static_assert((std::is_same<decltype(logbf(0)), float>::value), "");
4954684ddb6SLionel Sambuc static_assert((std::is_same<decltype(logbl(0)), long double>::value), "");
4964684ddb6SLionel Sambuc assert(logb(1) == 0);
4974684ddb6SLionel Sambuc }
4984684ddb6SLionel Sambuc
test_lrint()4994684ddb6SLionel Sambuc void test_lrint()
5004684ddb6SLionel Sambuc {
5014684ddb6SLionel Sambuc static_assert((std::is_same<decltype(lrint((double)0)), long>::value), "");
5024684ddb6SLionel Sambuc static_assert((std::is_same<decltype(lrintf(0)), long>::value), "");
5034684ddb6SLionel Sambuc static_assert((std::is_same<decltype(lrintl(0)), long>::value), "");
5044684ddb6SLionel Sambuc assert(lrint(1) == 1L);
5054684ddb6SLionel Sambuc }
5064684ddb6SLionel Sambuc
test_lround()5074684ddb6SLionel Sambuc void test_lround()
5084684ddb6SLionel Sambuc {
5094684ddb6SLionel Sambuc static_assert((std::is_same<decltype(lround((double)0)), long>::value), "");
5104684ddb6SLionel Sambuc static_assert((std::is_same<decltype(lroundf(0)), long>::value), "");
5114684ddb6SLionel Sambuc static_assert((std::is_same<decltype(lroundl(0)), long>::value), "");
5124684ddb6SLionel Sambuc assert(lround(1) == 1L);
5134684ddb6SLionel Sambuc }
5144684ddb6SLionel Sambuc
test_nan()5154684ddb6SLionel Sambuc void test_nan()
5164684ddb6SLionel Sambuc {
5174684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nan("")), double>::value), "");
5184684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nanf("")), float>::value), "");
5194684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nanl("")), long double>::value), "");
5204684ddb6SLionel Sambuc }
5214684ddb6SLionel Sambuc
test_nearbyint()5224684ddb6SLionel Sambuc void test_nearbyint()
5234684ddb6SLionel Sambuc {
5244684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nearbyint((double)0)), double>::value), "");
5254684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nearbyintf(0)), float>::value), "");
5264684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nearbyintl(0)), long double>::value), "");
5274684ddb6SLionel Sambuc assert(nearbyint(1) == 1);
5284684ddb6SLionel Sambuc }
5294684ddb6SLionel Sambuc
test_nextafter()5304684ddb6SLionel Sambuc void test_nextafter()
5314684ddb6SLionel Sambuc {
5324684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nextafter((double)0, (double)0)), double>::value), "");
5334684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nextafterf(0,0)), float>::value), "");
5344684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nextafterl(0,0)), long double>::value), "");
5354684ddb6SLionel Sambuc assert(nextafter(0,1) == hexfloat<double>(0x1, 0, -1074));
5364684ddb6SLionel Sambuc }
5374684ddb6SLionel Sambuc
test_nexttoward()5384684ddb6SLionel Sambuc void test_nexttoward()
5394684ddb6SLionel Sambuc {
5404684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nexttoward((double)0, (long double)0)), double>::value), "");
5414684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nexttowardf(0, (long double)0)), float>::value), "");
5424684ddb6SLionel Sambuc static_assert((std::is_same<decltype(nexttowardl(0, (long double)0)), long double>::value), "");
5434684ddb6SLionel Sambuc assert(nexttoward(0, 1) == hexfloat<double>(0x1, 0, -1074));
5444684ddb6SLionel Sambuc }
5454684ddb6SLionel Sambuc
test_remainder()5464684ddb6SLionel Sambuc void test_remainder()
5474684ddb6SLionel Sambuc {
5484684ddb6SLionel Sambuc static_assert((std::is_same<decltype(remainder((double)0, (double)0)), double>::value), "");
5494684ddb6SLionel Sambuc static_assert((std::is_same<decltype(remainderf(0,0)), float>::value), "");
5504684ddb6SLionel Sambuc static_assert((std::is_same<decltype(remainderl(0,0)), long double>::value), "");
5514684ddb6SLionel Sambuc static_assert((std::is_same<decltype(remainder((int)0, (int)0)), double>::value), "");
5524684ddb6SLionel Sambuc assert(remainder(0.5,1) == 0.5);
5534684ddb6SLionel Sambuc }
5544684ddb6SLionel Sambuc
test_remquo()5554684ddb6SLionel Sambuc void test_remquo()
5564684ddb6SLionel Sambuc {
5574684ddb6SLionel Sambuc int ip;
5584684ddb6SLionel Sambuc static_assert((std::is_same<decltype(remquo((double)0, (double)0, &ip)), double>::value), "");
5594684ddb6SLionel Sambuc static_assert((std::is_same<decltype(remquof(0,0, &ip)), float>::value), "");
5604684ddb6SLionel Sambuc static_assert((std::is_same<decltype(remquol(0,0, &ip)), long double>::value), "");
5614684ddb6SLionel Sambuc assert(remquo(0.5,1, &ip) == 0.5);
5624684ddb6SLionel Sambuc }
5634684ddb6SLionel Sambuc
test_rint()5644684ddb6SLionel Sambuc void test_rint()
5654684ddb6SLionel Sambuc {
5664684ddb6SLionel Sambuc static_assert((std::is_same<decltype(rint((double)0)), double>::value), "");
5674684ddb6SLionel Sambuc static_assert((std::is_same<decltype(rintf(0)), float>::value), "");
5684684ddb6SLionel Sambuc static_assert((std::is_same<decltype(rintl(0)), long double>::value), "");
5694684ddb6SLionel Sambuc assert(rint(1) == 1);
5704684ddb6SLionel Sambuc }
5714684ddb6SLionel Sambuc
test_round()5724684ddb6SLionel Sambuc void test_round()
5734684ddb6SLionel Sambuc {
5744684ddb6SLionel Sambuc static_assert((std::is_same<decltype(round((double)0)), double>::value), "");
5754684ddb6SLionel Sambuc static_assert((std::is_same<decltype(roundf(0)), float>::value), "");
5764684ddb6SLionel Sambuc static_assert((std::is_same<decltype(roundl(0)), long double>::value), "");
5774684ddb6SLionel Sambuc assert(round(1) == 1);
5784684ddb6SLionel Sambuc }
5794684ddb6SLionel Sambuc
test_scalbln()5804684ddb6SLionel Sambuc void test_scalbln()
5814684ddb6SLionel Sambuc {
5824684ddb6SLionel Sambuc static_assert((std::is_same<decltype(scalbln((double)0, (long)0)), double>::value), "");
5834684ddb6SLionel Sambuc static_assert((std::is_same<decltype(scalblnf(0, (long)0)), float>::value), "");
5844684ddb6SLionel Sambuc static_assert((std::is_same<decltype(scalblnl(0, (long)0)), long double>::value), "");
5854684ddb6SLionel Sambuc assert(scalbln(1, 1) == 2);
5864684ddb6SLionel Sambuc }
5874684ddb6SLionel Sambuc
test_scalbn()5884684ddb6SLionel Sambuc void test_scalbn()
5894684ddb6SLionel Sambuc {
5904684ddb6SLionel Sambuc static_assert((std::is_same<decltype(scalbn((double)0, (int)0)), double>::value), "");
5914684ddb6SLionel Sambuc static_assert((std::is_same<decltype(scalbnf(0, (int)0)), float>::value), "");
5924684ddb6SLionel Sambuc static_assert((std::is_same<decltype(scalbnl(0, (int)0)), long double>::value), "");
5934684ddb6SLionel Sambuc assert(scalbn(1, 1) == 2);
5944684ddb6SLionel Sambuc }
5954684ddb6SLionel Sambuc
test_tgamma()5964684ddb6SLionel Sambuc void test_tgamma()
5974684ddb6SLionel Sambuc {
5984684ddb6SLionel Sambuc static_assert((std::is_same<decltype(tgamma((double)0)), double>::value), "");
5994684ddb6SLionel Sambuc static_assert((std::is_same<decltype(tgammaf(0)), float>::value), "");
6004684ddb6SLionel Sambuc static_assert((std::is_same<decltype(tgammal(0)), long double>::value), "");
6014684ddb6SLionel Sambuc assert(tgamma(1) == 1);
6024684ddb6SLionel Sambuc }
6034684ddb6SLionel Sambuc
test_trunc()6044684ddb6SLionel Sambuc void test_trunc()
6054684ddb6SLionel Sambuc {
6064684ddb6SLionel Sambuc static_assert((std::is_same<decltype(trunc((double)0)), double>::value), "");
6074684ddb6SLionel Sambuc static_assert((std::is_same<decltype(truncf(0)), float>::value), "");
6084684ddb6SLionel Sambuc static_assert((std::is_same<decltype(truncl(0)), long double>::value), "");
6094684ddb6SLionel Sambuc assert(trunc(1) == 1);
6104684ddb6SLionel Sambuc }
6114684ddb6SLionel Sambuc
main()6124684ddb6SLionel Sambuc int main()
6134684ddb6SLionel Sambuc {
6144684ddb6SLionel Sambuc test_acos();
6154684ddb6SLionel Sambuc test_asin();
6164684ddb6SLionel Sambuc test_atan();
6174684ddb6SLionel Sambuc test_atan2();
6184684ddb6SLionel Sambuc test_ceil();
6194684ddb6SLionel Sambuc test_cos();
6204684ddb6SLionel Sambuc test_cosh();
6214684ddb6SLionel Sambuc test_exp();
6224684ddb6SLionel Sambuc test_fabs();
6234684ddb6SLionel Sambuc test_floor();
6244684ddb6SLionel Sambuc test_fmod();
6254684ddb6SLionel Sambuc test_frexp();
6264684ddb6SLionel Sambuc test_ldexp();
6274684ddb6SLionel Sambuc test_log();
6284684ddb6SLionel Sambuc test_log10();
6294684ddb6SLionel Sambuc test_modf();
6304684ddb6SLionel Sambuc test_pow();
6314684ddb6SLionel Sambuc test_sin();
6324684ddb6SLionel Sambuc test_sinh();
6334684ddb6SLionel Sambuc test_sqrt();
6344684ddb6SLionel Sambuc test_tan();
6354684ddb6SLionel Sambuc test_tanh();
6364684ddb6SLionel Sambuc test_signbit();
6374684ddb6SLionel Sambuc test_fpclassify();
6384684ddb6SLionel Sambuc test_isfinite();
6394684ddb6SLionel Sambuc test_isinf();
6404684ddb6SLionel Sambuc test_isnan();
6414684ddb6SLionel Sambuc test_isnormal();
6424684ddb6SLionel Sambuc test_isgreater();
6434684ddb6SLionel Sambuc test_isgreaterequal();
6444684ddb6SLionel Sambuc test_isless();
6454684ddb6SLionel Sambuc test_islessequal();
6464684ddb6SLionel Sambuc test_islessgreater();
6474684ddb6SLionel Sambuc test_isunordered();
6484684ddb6SLionel Sambuc test_acosh();
6494684ddb6SLionel Sambuc test_asinh();
6504684ddb6SLionel Sambuc test_atanh();
6514684ddb6SLionel Sambuc test_cbrt();
6524684ddb6SLionel Sambuc test_copysign();
6534684ddb6SLionel Sambuc test_erf();
6544684ddb6SLionel Sambuc test_erfc();
6554684ddb6SLionel Sambuc test_exp2();
6564684ddb6SLionel Sambuc test_expm1();
6574684ddb6SLionel Sambuc test_fdim();
6584684ddb6SLionel Sambuc test_fma();
6594684ddb6SLionel Sambuc test_fmax();
6604684ddb6SLionel Sambuc test_fmin();
6614684ddb6SLionel Sambuc test_hypot();
6624684ddb6SLionel Sambuc test_ilogb();
6634684ddb6SLionel Sambuc test_lgamma();
6644684ddb6SLionel Sambuc test_llrint();
6654684ddb6SLionel Sambuc test_llround();
6664684ddb6SLionel Sambuc test_log1p();
6674684ddb6SLionel Sambuc test_log2();
6684684ddb6SLionel Sambuc test_logb();
6694684ddb6SLionel Sambuc test_lrint();
6704684ddb6SLionel Sambuc test_lround();
6714684ddb6SLionel Sambuc test_nan();
6724684ddb6SLionel Sambuc test_nearbyint();
6734684ddb6SLionel Sambuc test_nextafter();
6744684ddb6SLionel Sambuc test_nexttoward();
6754684ddb6SLionel Sambuc test_remainder();
6764684ddb6SLionel Sambuc test_remquo();
6774684ddb6SLionel Sambuc test_rint();
6784684ddb6SLionel Sambuc test_round();
6794684ddb6SLionel Sambuc test_scalbln();
6804684ddb6SLionel Sambuc test_scalbn();
6814684ddb6SLionel Sambuc test_tgamma();
6824684ddb6SLionel Sambuc test_trunc();
6834684ddb6SLionel Sambuc }
684