]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/functions.cc
3 // 2006-02-07 Paolo Carlini <pcarlini@suse.de>
5 // Copyright (C) 2006-2014 Free Software Foundation, Inc.
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)
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.
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/>.
22 // 8.16 Additions to header <cmath>
28 #if _GLIBCXX_USE_C99_MATH_TR1
32 long double ld0
= 0.0l;
33 const char* str
= "NAN";
45 ret
= std::tr1::acosh(d0
);
46 fret
= std::tr1::acoshf(f0
);
47 ldret
= std::tr1::acoshl(ld0
);
49 ret
= std::tr1::asinh(d0
);
50 fret
= std::tr1::asinhf(f0
);
51 ldret
= std::tr1::asinhl(ld0
);
53 ret
= std::tr1::atanh(d0
);
54 fret
= std::tr1::atanhf(f0
);
55 ldret
= std::tr1::atanhl(ld0
);
57 ret
= std::tr1::cbrt(d0
);
58 fret
= std::tr1::cbrtf(f0
);
59 ldret
= std::tr1::cbrtl(ld0
);
61 ret
= std::tr1::copysign(d0
, d0
);
62 fret
= std::tr1::copysignf(f0
, f0
);
63 ldret
= std::tr1::copysignl(ld0
, ld0
);
65 ret
= std::tr1::erf(d0
);
66 fret
= std::tr1::erff(f0
);
67 ldret
= std::tr1::erfl(ld0
);
69 ret
= std::tr1::erfc(d0
);
70 fret
= std::tr1::erfcf(f0
);
71 ldret
= std::tr1::erfcl(ld0
);
73 ret
= std::tr1::exp2(d0
);
74 fret
= std::tr1::exp2f(f0
);
75 ldret
= std::tr1::exp2l(ld0
);
77 ret
= std::tr1::expm1(d0
);
78 fret
= std::tr1::expm1f(f0
);
79 ldret
= std::tr1::expm1l(ld0
);
81 ret
= std::tr1::fdim(d0
, d0
);
82 fret
= std::tr1::fdimf(f0
, f0
);
83 ldret
= std::tr1::fdiml(ld0
, ld0
);
85 ret
= std::tr1::fma(d0
, d0
, d0
);
86 fret
= std::tr1::fmaf(f0
, f0
, f0
);
87 ldret
= std::tr1::fmal(ld0
, ld0
, ld0
);
89 ret
= std::tr1::fmax(d0
, d0
);
90 fret
= std::tr1::fmaxf(f0
, f0
);
91 ldret
= std::tr1::fmaxl(ld0
, ld0
);
93 ret
= std::tr1::fmin(d0
, d0
);
94 fret
= std::tr1::fminf(f0
, f0
);
95 ldret
= std::tr1::fminl(ld0
, ld0
);
97 ret
= std::tr1::hypot(d0
, d0
);
98 fret
= std::tr1::hypotf(f0
, f0
);
99 ldret
= std::tr1::hypotl(ld0
, ld0
);
101 iret
= std::tr1::ilogb(d0
);
102 iret
= std::tr1::ilogbf(f0
);
103 iret
= std::tr1::ilogbl(ld0
);
105 ret
= std::tr1::lgamma(d0
);
106 fret
= std::tr1::lgammaf(f0
);
107 ldret
= std::tr1::lgammal(ld0
);
109 llret
= std::tr1::llrint(d0
);
110 llret
= std::tr1::llrintf(f0
);
111 llret
= std::tr1::llrintl(ld0
);
113 llret
= std::tr1::llround(d0
);
114 llret
= std::tr1::llroundf(f0
);
115 llret
= std::tr1::llroundl(ld0
);
117 ret
= std::tr1::log1p(d0
);
118 fret
= std::tr1::log1pf(f0
);
119 ldret
= std::tr1::log1pl(ld0
);
121 ret
= std::tr1::log2(d0
);
122 fret
= std::tr1::log2f(f0
);
123 ldret
= std::tr1::log2l(ld0
);
125 ret
= std::tr1::logb(d0
);
126 fret
= std::tr1::logbf(f0
);
127 ldret
= std::tr1::logbl(ld0
);
129 lret
= std::tr1::lrint(d0
);
130 lret
= std::tr1::lrintf(f0
);
131 lret
= std::tr1::lrintl(ld0
);
133 lret
= std::tr1::lround(d0
);
134 lret
= std::tr1::lroundf(f0
);
135 lret
= std::tr1::lroundl(ld0
);
137 ret
= std::tr1::nan(str
);
138 fret
= std::tr1::nanf(str
);
139 ldret
= std::tr1::nanl(str
);
141 ret
= std::tr1::nearbyint(d0
);
142 fret
= std::tr1::nearbyintf(f0
);
143 ldret
= std::tr1::nearbyintl(ld0
);
145 ret
= std::tr1::nextafter(d0
, d0
);
146 fret
= std::tr1::nextafterf(f0
, f0
);
147 ldret
= std::tr1::nextafterl(ld0
, ld0
);
149 ret
= std::tr1::nexttoward(d0
, ld0
);
150 fret
= std::tr1::nexttowardf(f0
, ld0
);
151 ldret
= std::tr1::nexttowardl(ld0
, ld0
);
153 ret
= std::tr1::remainder(d0
, d0
);
154 fret
= std::tr1::remainderf(f0
, f0
);
155 ldret
= std::tr1::remainderl(ld0
, ld0
);
157 ret
= std::tr1::remquo(d0
, d0
, pquo
);
158 fret
= std::tr1::remquof(f0
, f0
, pquo
);
159 ldret
= std::tr1::remquol(ld0
, ld0
, pquo
);
161 ret
= std::tr1::rint(d0
);
162 fret
= std::tr1::rintf(f0
);
163 ldret
= std::tr1::rintl(ld0
);
165 ret
= std::tr1::round(d0
);
166 fret
= std::tr1::roundf(f0
);
167 ldret
= std::tr1::roundl(ld0
);
169 ret
= std::tr1::scalbln(d0
, lex
);
170 fret
= std::tr1::scalblnf(f0
, lex
);
171 ldret
= std::tr1::scalblnl(ld0
, lex
);
173 ret
= std::tr1::scalbn(d0
, ex
);
174 fret
= std::tr1::scalbnf(f0
, ex
);
175 ldret
= std::tr1::scalbnl(ld0
, ex
);
177 ret
= std::tr1::tgamma(d0
);
178 fret
= std::tr1::tgammaf(f0
);
179 ldret
= std::tr1::tgammal(ld0
);
181 ret
= std::tr1::trunc(d0
);
182 fret
= std::tr1::truncf(f0
);
183 ldret
= std::tr1::truncl(ld0
);
185 ret
= ret
; // Suppress unused warnings.