1 |
424 |
jeremybenn |
// { dg-do compile }
|
2 |
|
|
|
3 |
|
|
// 2006-03-07 Paolo Carlini <pcarlini@suse.de>
|
4 |
|
|
//
|
5 |
|
|
// Copyright (C) 2006, 2009 Free Software Foundation, Inc.
|
6 |
|
|
//
|
7 |
|
|
// This file is part of the GNU ISO C++ Library. This library is free
|
8 |
|
|
// software; you can redistribute it and/or modify it under the
|
9 |
|
|
// terms of the GNU General Public License as published by the
|
10 |
|
|
// Free Software Foundation; either version 3, or (at your option)
|
11 |
|
|
// any later version.
|
12 |
|
|
//
|
13 |
|
|
// This library is distributed in the hope that it will be useful,
|
14 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
|
|
// GNU General Public License for more details.
|
17 |
|
|
//
|
18 |
|
|
// You should have received a copy of the GNU General Public License along
|
19 |
|
|
// with this library; see the file COPYING3. If not see
|
20 |
|
|
// <http://www.gnu.org/licenses/>.
|
21 |
|
|
|
22 |
|
|
// 8.16.4 Additional overloads
|
23 |
|
|
|
24 |
|
|
#include <tr1/cmath>
|
25 |
|
|
#include <testsuite_tr1.h>
|
26 |
|
|
|
27 |
|
|
void test01()
|
28 |
|
|
{
|
29 |
|
|
#if _GLIBCXX_USE_C99_MATH_TR1
|
30 |
|
|
|
31 |
|
|
using namespace __gnu_test;
|
32 |
|
|
|
33 |
|
|
double d0 = 0.0;
|
34 |
|
|
float f0 = 0.0f;
|
35 |
|
|
long double ld0 = 0.0l;
|
36 |
|
|
int i0 = 0;
|
37 |
|
|
int* pquo = 0;
|
38 |
|
|
long lex = 0l;
|
39 |
|
|
int ex = 0;
|
40 |
|
|
|
41 |
|
|
check_ret_type<double>(std::tr1::atan2(d0, d0));
|
42 |
|
|
check_ret_type<double>(std::tr1::atan2(d0, f0));
|
43 |
|
|
check_ret_type<float>(std::tr1::atan2(f0, f0));
|
44 |
|
|
check_ret_type<long double>(std::tr1::atan2(ld0, ld0));
|
45 |
|
|
check_ret_type<long double>(std::tr1::atan2(ld0, d0));
|
46 |
|
|
check_ret_type<double>(std::tr1::atan2(i0, i0));
|
47 |
|
|
check_ret_type<double>(std::tr1::atan2(d0, i0));
|
48 |
|
|
|
49 |
|
|
check_ret_type<double>(std::tr1::acosh(d0));
|
50 |
|
|
check_ret_type<float>(std::tr1::acosh(f0));
|
51 |
|
|
check_ret_type<long double>(std::tr1::acosh(ld0));
|
52 |
|
|
check_ret_type<double>(std::tr1::acosh(i0));
|
53 |
|
|
|
54 |
|
|
check_ret_type<double>(std::tr1::asinh(d0));
|
55 |
|
|
check_ret_type<float>(std::tr1::asinh(f0));
|
56 |
|
|
check_ret_type<long double>(std::tr1::asinh(ld0));
|
57 |
|
|
check_ret_type<double>(std::tr1::asinh(i0));
|
58 |
|
|
|
59 |
|
|
check_ret_type<double>(std::tr1::atanh(d0));
|
60 |
|
|
check_ret_type<float>(std::tr1::atanh(f0));
|
61 |
|
|
check_ret_type<long double>(std::tr1::atanh(ld0));
|
62 |
|
|
check_ret_type<double>(std::tr1::atanh(i0));
|
63 |
|
|
|
64 |
|
|
check_ret_type<double>(std::tr1::cbrt(d0));
|
65 |
|
|
check_ret_type<float>(std::tr1::cbrt(f0));
|
66 |
|
|
check_ret_type<long double>(std::tr1::cbrt(ld0));
|
67 |
|
|
check_ret_type<double>(std::tr1::cbrt(i0));
|
68 |
|
|
|
69 |
|
|
check_ret_type<double>(std::tr1::copysign(d0, d0));
|
70 |
|
|
check_ret_type<double>(std::tr1::copysign(d0, f0));
|
71 |
|
|
check_ret_type<float>(std::tr1::copysign(f0, f0));
|
72 |
|
|
check_ret_type<long double>(std::tr1::copysign(ld0, ld0));
|
73 |
|
|
check_ret_type<long double>(std::tr1::copysign(ld0, d0));
|
74 |
|
|
check_ret_type<double>(std::tr1::copysign(i0, i0));
|
75 |
|
|
check_ret_type<double>(std::tr1::copysign(d0, i0));
|
76 |
|
|
|
77 |
|
|
check_ret_type<double>(std::tr1::erf(d0));
|
78 |
|
|
check_ret_type<float>(std::tr1::erf(f0));
|
79 |
|
|
check_ret_type<long double>(std::tr1::erf(ld0));
|
80 |
|
|
check_ret_type<double>(std::tr1::erf(i0));
|
81 |
|
|
|
82 |
|
|
check_ret_type<double>(std::tr1::erfc(d0));
|
83 |
|
|
check_ret_type<float>(std::tr1::erfc(f0));
|
84 |
|
|
check_ret_type<long double>(std::tr1::erfc(ld0));
|
85 |
|
|
check_ret_type<double>(std::tr1::erfc(i0));
|
86 |
|
|
|
87 |
|
|
check_ret_type<double>(std::tr1::exp2(d0));
|
88 |
|
|
check_ret_type<float>(std::tr1::exp2(f0));
|
89 |
|
|
check_ret_type<long double>(std::tr1::exp2(ld0));
|
90 |
|
|
check_ret_type<double>(std::tr1::exp2(i0));
|
91 |
|
|
|
92 |
|
|
check_ret_type<double>(std::tr1::expm1(d0));
|
93 |
|
|
check_ret_type<float>(std::tr1::expm1(f0));
|
94 |
|
|
check_ret_type<long double>(std::tr1::expm1(ld0));
|
95 |
|
|
check_ret_type<double>(std::tr1::expm1(i0));
|
96 |
|
|
|
97 |
|
|
check_ret_type<double>(std::tr1::fdim(d0, d0));
|
98 |
|
|
check_ret_type<double>(std::tr1::fdim(d0, f0));
|
99 |
|
|
check_ret_type<float>(std::tr1::fdim(f0, f0));
|
100 |
|
|
check_ret_type<long double>(std::tr1::fdim(ld0, ld0));
|
101 |
|
|
check_ret_type<long double>(std::tr1::fdim(ld0, d0));
|
102 |
|
|
check_ret_type<double>(std::tr1::fdim(i0, i0));
|
103 |
|
|
check_ret_type<double>(std::tr1::fdim(d0, i0));
|
104 |
|
|
|
105 |
|
|
check_ret_type<double>(std::tr1::fma(d0, d0, d0));
|
106 |
|
|
check_ret_type<double>(std::tr1::fma(d0, f0, d0));
|
107 |
|
|
check_ret_type<float>(std::tr1::fma(f0, f0, f0));
|
108 |
|
|
check_ret_type<long double>(std::tr1::fma(ld0, ld0, ld0));
|
109 |
|
|
check_ret_type<long double>(std::tr1::fma(ld0, d0, f0));
|
110 |
|
|
check_ret_type<double>(std::tr1::fma(i0, i0, i0));
|
111 |
|
|
check_ret_type<double>(std::tr1::fma(d0, i0, f0));
|
112 |
|
|
|
113 |
|
|
check_ret_type<double>(std::tr1::fmax(d0, d0));
|
114 |
|
|
check_ret_type<double>(std::tr1::fmax(d0, f0));
|
115 |
|
|
check_ret_type<float>(std::tr1::fmax(f0, f0));
|
116 |
|
|
check_ret_type<long double>(std::tr1::fmax(ld0, ld0));
|
117 |
|
|
check_ret_type<long double>(std::tr1::fmax(ld0, d0));
|
118 |
|
|
check_ret_type<double>(std::tr1::fmax(i0, i0));
|
119 |
|
|
check_ret_type<double>(std::tr1::fmax(d0, i0));
|
120 |
|
|
|
121 |
|
|
check_ret_type<double>(std::tr1::fmin(d0, d0));
|
122 |
|
|
check_ret_type<double>(std::tr1::fmin(d0, f0));
|
123 |
|
|
check_ret_type<float>(std::tr1::fmin(f0, f0));
|
124 |
|
|
check_ret_type<long double>(std::tr1::fmin(ld0, ld0));
|
125 |
|
|
check_ret_type<long double>(std::tr1::fmin(ld0, d0));
|
126 |
|
|
check_ret_type<double>(std::tr1::fmin(i0, i0));
|
127 |
|
|
check_ret_type<double>(std::tr1::fmin(d0, i0));
|
128 |
|
|
|
129 |
|
|
check_ret_type<double>(std::tr1::hypot(d0, d0));
|
130 |
|
|
check_ret_type<double>(std::tr1::hypot(d0, f0));
|
131 |
|
|
check_ret_type<float>(std::tr1::hypot(f0, f0));
|
132 |
|
|
check_ret_type<long double>(std::tr1::hypot(ld0, ld0));
|
133 |
|
|
check_ret_type<long double>(std::tr1::hypot(ld0, d0));
|
134 |
|
|
check_ret_type<double>(std::tr1::hypot(i0, i0));
|
135 |
|
|
check_ret_type<double>(std::tr1::hypot(d0, i0));
|
136 |
|
|
|
137 |
|
|
check_ret_type<int>(std::tr1::ilogb(d0));
|
138 |
|
|
check_ret_type<int>(std::tr1::ilogb(f0));
|
139 |
|
|
check_ret_type<int>(std::tr1::ilogb(ld0));
|
140 |
|
|
check_ret_type<int>(std::tr1::ilogb(i0));
|
141 |
|
|
|
142 |
|
|
check_ret_type<double>(std::tr1::lgamma(d0));
|
143 |
|
|
check_ret_type<float>(std::tr1::lgamma(f0));
|
144 |
|
|
check_ret_type<long double>(std::tr1::lgamma(ld0));
|
145 |
|
|
check_ret_type<double>(std::tr1::lgamma(i0));
|
146 |
|
|
|
147 |
|
|
check_ret_type<long long>(std::tr1::llrint(d0));
|
148 |
|
|
check_ret_type<long long>(std::tr1::llrint(f0));
|
149 |
|
|
check_ret_type<long long>(std::tr1::llrint(ld0));
|
150 |
|
|
check_ret_type<long long>(std::tr1::llrint(i0));
|
151 |
|
|
|
152 |
|
|
check_ret_type<long long>(std::tr1::llround(d0));
|
153 |
|
|
check_ret_type<long long>(std::tr1::llround(f0));
|
154 |
|
|
check_ret_type<long long>(std::tr1::llround(ld0));
|
155 |
|
|
check_ret_type<long long>(std::tr1::llround(i0));
|
156 |
|
|
|
157 |
|
|
check_ret_type<double>(std::tr1::log1p(d0));
|
158 |
|
|
check_ret_type<float>(std::tr1::log1p(f0));
|
159 |
|
|
check_ret_type<long double>(std::tr1::log1p(ld0));
|
160 |
|
|
check_ret_type<double>(std::tr1::log1p(i0));
|
161 |
|
|
|
162 |
|
|
// DR 568.
|
163 |
|
|
check_ret_type<double>(std::tr1::log2(d0));
|
164 |
|
|
check_ret_type<float>(std::tr1::log2(f0));
|
165 |
|
|
check_ret_type<long double>(std::tr1::log2(ld0));
|
166 |
|
|
check_ret_type<double>(std::tr1::log2(i0));
|
167 |
|
|
|
168 |
|
|
check_ret_type<double>(std::tr1::logb(d0));
|
169 |
|
|
check_ret_type<float>(std::tr1::logb(f0));
|
170 |
|
|
check_ret_type<long double>(std::tr1::logb(ld0));
|
171 |
|
|
check_ret_type<double>(std::tr1::logb(i0));
|
172 |
|
|
|
173 |
|
|
check_ret_type<long>(std::tr1::lrint(d0));
|
174 |
|
|
check_ret_type<long>(std::tr1::lrint(f0));
|
175 |
|
|
check_ret_type<long>(std::tr1::lrint(ld0));
|
176 |
|
|
check_ret_type<long>(std::tr1::lrint(i0));
|
177 |
|
|
|
178 |
|
|
check_ret_type<long>(std::tr1::lround(d0));
|
179 |
|
|
check_ret_type<long>(std::tr1::lround(f0));
|
180 |
|
|
check_ret_type<long>(std::tr1::lround(ld0));
|
181 |
|
|
check_ret_type<long>(std::tr1::lround(i0));
|
182 |
|
|
|
183 |
|
|
check_ret_type<double>(std::tr1::nearbyint(d0));
|
184 |
|
|
check_ret_type<float>(std::tr1::nearbyint(f0));
|
185 |
|
|
check_ret_type<long double>(std::tr1::nearbyint(ld0));
|
186 |
|
|
check_ret_type<double>(std::tr1::nearbyint(i0));
|
187 |
|
|
|
188 |
|
|
check_ret_type<double>(std::tr1::nextafter(d0, d0));
|
189 |
|
|
check_ret_type<double>(std::tr1::nextafter(d0, f0));
|
190 |
|
|
check_ret_type<float>(std::tr1::nextafter(f0, f0));
|
191 |
|
|
check_ret_type<long double>(std::tr1::nextafter(ld0, ld0));
|
192 |
|
|
check_ret_type<long double>(std::tr1::nextafter(ld0, d0));
|
193 |
|
|
check_ret_type<double>(std::tr1::nextafter(i0, i0));
|
194 |
|
|
check_ret_type<double>(std::tr1::nextafter(d0, i0));
|
195 |
|
|
|
196 |
|
|
check_ret_type<double>(std::tr1::nexttoward(d0, ld0));
|
197 |
|
|
check_ret_type<float>(std::tr1::nexttoward(f0, ld0));
|
198 |
|
|
check_ret_type<long double>(std::tr1::nexttoward(ld0, ld0));
|
199 |
|
|
check_ret_type<double>(std::tr1::nexttoward(i0, ld0));
|
200 |
|
|
|
201 |
|
|
check_ret_type<double>(std::tr1::pow(d0, d0));
|
202 |
|
|
check_ret_type<double>(std::tr1::pow(d0, f0));
|
203 |
|
|
check_ret_type<float>(std::tr1::pow(f0, f0));
|
204 |
|
|
check_ret_type<long double>(std::tr1::pow(ld0, ld0));
|
205 |
|
|
check_ret_type<long double>(std::tr1::pow(ld0, d0));
|
206 |
|
|
check_ret_type<double>(std::tr1::pow(i0, i0));
|
207 |
|
|
check_ret_type<double>(std::tr1::pow(d0, i0));
|
208 |
|
|
check_ret_type<double>(std::tr1::pow(f0, i0));
|
209 |
|
|
|
210 |
|
|
check_ret_type<double>(std::tr1::remainder(d0, d0));
|
211 |
|
|
check_ret_type<double>(std::tr1::remainder(d0, f0));
|
212 |
|
|
check_ret_type<float>(std::tr1::remainder(f0, f0));
|
213 |
|
|
check_ret_type<long double>(std::tr1::remainder(ld0, ld0));
|
214 |
|
|
check_ret_type<long double>(std::tr1::remainder(ld0, d0));
|
215 |
|
|
check_ret_type<double>(std::tr1::remainder(i0, i0));
|
216 |
|
|
check_ret_type<double>(std::tr1::remainder(d0, i0));
|
217 |
|
|
|
218 |
|
|
check_ret_type<double>(std::tr1::remquo(d0, d0, pquo));
|
219 |
|
|
check_ret_type<double>(std::tr1::remquo(d0, f0, pquo));
|
220 |
|
|
check_ret_type<float>(std::tr1::remquo(f0, f0, pquo));
|
221 |
|
|
check_ret_type<long double>(std::tr1::remquo(ld0, ld0, pquo));
|
222 |
|
|
check_ret_type<long double>(std::tr1::remquo(ld0, d0, pquo));
|
223 |
|
|
check_ret_type<double>(std::tr1::remquo(i0, i0, pquo));
|
224 |
|
|
check_ret_type<double>(std::tr1::remquo(d0, i0, pquo));
|
225 |
|
|
|
226 |
|
|
check_ret_type<double>(std::tr1::rint(d0));
|
227 |
|
|
check_ret_type<float>(std::tr1::rint(f0));
|
228 |
|
|
check_ret_type<long double>(std::tr1::rint(ld0));
|
229 |
|
|
check_ret_type<double>(std::tr1::rint(i0));
|
230 |
|
|
|
231 |
|
|
check_ret_type<double>(std::tr1::round(d0));
|
232 |
|
|
check_ret_type<float>(std::tr1::round(f0));
|
233 |
|
|
check_ret_type<long double>(std::tr1::round(ld0));
|
234 |
|
|
check_ret_type<double>(std::tr1::round(i0));
|
235 |
|
|
|
236 |
|
|
check_ret_type<double>(std::tr1::scalbln(d0, lex));
|
237 |
|
|
check_ret_type<float>(std::tr1::scalbln(f0, lex));
|
238 |
|
|
check_ret_type<long double>(std::tr1::scalbln(ld0, lex));
|
239 |
|
|
check_ret_type<double>(std::tr1::scalbln(i0, lex));
|
240 |
|
|
|
241 |
|
|
check_ret_type<double>(std::tr1::scalbn(d0, ex));
|
242 |
|
|
check_ret_type<float>(std::tr1::scalbn(f0, ex));
|
243 |
|
|
check_ret_type<long double>(std::tr1::scalbn(ld0, ex));
|
244 |
|
|
check_ret_type<double>(std::tr1::scalbn(i0, ex));
|
245 |
|
|
|
246 |
|
|
check_ret_type<double>(std::tr1::tgamma(d0));
|
247 |
|
|
check_ret_type<float>(std::tr1::tgamma(f0));
|
248 |
|
|
check_ret_type<long double>(std::tr1::tgamma(ld0));
|
249 |
|
|
check_ret_type<double>(std::tr1::tgamma(i0));
|
250 |
|
|
|
251 |
|
|
check_ret_type<double>(std::tr1::trunc(d0));
|
252 |
|
|
check_ret_type<float>(std::tr1::trunc(f0));
|
253 |
|
|
check_ret_type<long double>(std::tr1::trunc(ld0));
|
254 |
|
|
check_ret_type<double>(std::tr1::trunc(i0));
|
255 |
|
|
|
256 |
|
|
#endif
|
257 |
|
|
}
|