| 1 |
// -*- C++ -*- C forwarding header. |
| 2 |
|
| 3 |
// Copyright (C) 1997-2025 Free Software Foundation, Inc. |
| 4 |
// |
| 5 |
// This file is part of the GNU ISO C++ Library. This library is free |
| 6 |
// software; you can redistribute it and/or modify it under the |
| 7 |
// terms of the GNU General Public License as published by the |
| 8 |
// Free Software Foundation; either version 3, or (at your option) |
| 9 |
// any later version. |
| 10 |
|
| 11 |
// This library is distributed in the hope that it will be useful, |
| 12 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
// GNU General Public License for more details. |
| 15 |
|
| 16 |
// Under Section 7 of GPL version 3, you are granted additional |
| 17 |
// permissions described in the GCC Runtime Library Exception, version |
| 18 |
// 3.1, as published by the Free Software Foundation. |
| 19 |
|
| 20 |
// You should have received a copy of the GNU General Public License and |
| 21 |
// a copy of the GCC Runtime Library Exception along with this program; |
| 22 |
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 23 |
// <http://www.gnu.org/licenses/>. |
| 24 |
|
| 25 |
/** @file include/cmath |
| 26 |
* This is a Standard C++ Library file. You should @c #include this file |
| 27 |
* in your programs, rather than any of the @a *.h implementation files. |
| 28 |
* |
| 29 |
* This is the C++ version of the Standard C Library header @c math.h, |
| 30 |
* and its contents are (mostly) the same as that header, but are all |
| 31 |
* contained in the namespace @c std (except for names which are defined |
| 32 |
* as macros in C). |
| 33 |
*/ |
| 34 |
|
| 35 |
// |
| 36 |
// ISO C++ 14882: 26.5 C library |
| 37 |
// |
| 38 |
|
| 39 |
#ifndef _GLIBCXX_CMATH |
| 40 |
#define _GLIBCXX_CMATH 1 |
| 41 |
|
| 42 |
#ifdef _GLIBCXX_SYSHDR |
| 43 |
#pragma GCC system_header |
| 44 |
#endif |
| 45 |
|
| 46 |
#include <bits/c++config.h> |
| 47 |
#include <bits/cpp_type_traits.h> |
| 48 |
#include <ext/type_traits.h> |
| 49 |
|
| 50 |
#include <math.h> |
| 51 |
|
| 52 |
// Get rid of those macros defined in <math.h> in lieu of real functions. |
| 53 |
#undef abs |
| 54 |
#undef div |
| 55 |
#undef acos |
| 56 |
#undef asin |
| 57 |
#undef atan |
| 58 |
#undef atan2 |
| 59 |
#undef ceil |
| 60 |
#undef cos |
| 61 |
#undef cosh |
| 62 |
#undef exp |
| 63 |
#undef fabs |
| 64 |
#undef floor |
| 65 |
#undef fmod |
| 66 |
#undef frexp |
| 67 |
#undef ldexp |
| 68 |
#undef log |
| 69 |
#undef log10 |
| 70 |
#undef modf |
| 71 |
#undef pow |
| 72 |
#undef sin |
| 73 |
#undef sinh |
| 74 |
#undef sqrt |
| 75 |
#undef tan |
| 76 |
#undef tanh |
| 77 |
|
| 78 |
namespace std _GLIBCXX_VISIBILITY(default) |
| 79 |
{ |
| 80 |
_GLIBCXX_BEGIN_NAMESPACE_VERSION |
| 81 |
|
| 82 |
inline double |
| 83 |
abs(double __x) |
| 84 |
{ return __builtin_fabs(__x); } |
| 85 |
|
| 86 |
inline float |
| 87 |
abs(float __x) |
| 88 |
{ return __builtin_fabsf(__x); } |
| 89 |
|
| 90 |
inline long double |
| 91 |
abs(long double __x) |
| 92 |
{ return __builtin_fabsl(__x); } |
| 93 |
|
| 94 |
template<typename _Tp> |
| 95 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 96 |
double>::__type |
| 97 |
abs(_Tp __x) |
| 98 |
{ return __builtin_fabs(__x); } |
| 99 |
|
| 100 |
using ::acos; |
| 101 |
|
| 102 |
inline float |
| 103 |
acos(float __x) |
| 104 |
{ return __builtin_acosf(__x); } |
| 105 |
|
| 106 |
inline long double |
| 107 |
acos(long double __x) |
| 108 |
{ return __builtin_acosl(__x); } |
| 109 |
|
| 110 |
template<typename _Tp> |
| 111 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 112 |
double>::__type |
| 113 |
acos(_Tp __x) |
| 114 |
{ return __builtin_acos(__x); } |
| 115 |
|
| 116 |
using ::asin; |
| 117 |
|
| 118 |
inline float |
| 119 |
asin(float __x) |
| 120 |
{ return __builtin_asinf(__x); } |
| 121 |
|
| 122 |
inline long double |
| 123 |
asin(long double __x) |
| 124 |
{ return __builtin_asinl(__x); } |
| 125 |
|
| 126 |
template<typename _Tp> |
| 127 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 128 |
double>::__type |
| 129 |
asin(_Tp __x) |
| 130 |
{ return __builtin_asin(__x); } |
| 131 |
|
| 132 |
using ::atan; |
| 133 |
|
| 134 |
inline float |
| 135 |
atan(float __x) |
| 136 |
{ return __builtin_atanf(__x); } |
| 137 |
|
| 138 |
inline long double |
| 139 |
atan(long double __x) |
| 140 |
{ return __builtin_atanl(__x); } |
| 141 |
|
| 142 |
template<typename _Tp> |
| 143 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 144 |
double>::__type |
| 145 |
atan(_Tp __x) |
| 146 |
{ return __builtin_atan(__x); } |
| 147 |
|
| 148 |
using ::atan2; |
| 149 |
|
| 150 |
inline float |
| 151 |
atan2(float __y, float __x) |
| 152 |
{ return __builtin_atan2f(__y, __x); } |
| 153 |
|
| 154 |
inline long double |
| 155 |
atan2(long double __y, long double __x) |
| 156 |
{ return __builtin_atan2l(__y, __x); } |
| 157 |
|
| 158 |
template<typename _Tp, typename _Up> |
| 159 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value |
| 160 |
&& __is_integer<_Up>::__value, |
| 161 |
double>::__type |
| 162 |
atan2(_Tp __y, _Up __x) |
| 163 |
{ return __builtin_atan2(__y, __x); } |
| 164 |
|
| 165 |
using ::ceil; |
| 166 |
|
| 167 |
inline float |
| 168 |
ceil(float __x) |
| 169 |
{ return __builtin_ceilf(__x); } |
| 170 |
|
| 171 |
inline long double |
| 172 |
ceil(long double __x) |
| 173 |
{ return __builtin_ceill(__x); } |
| 174 |
|
| 175 |
template<typename _Tp> |
| 176 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 177 |
double>::__type |
| 178 |
ceil(_Tp __x) |
| 179 |
{ return __builtin_ceil(__x); } |
| 180 |
|
| 181 |
using ::cos; |
| 182 |
|
| 183 |
inline float |
| 184 |
cos(float __x) |
| 185 |
{ return __builtin_cosf(__x); } |
| 186 |
|
| 187 |
inline long double |
| 188 |
cos(long double __x) |
| 189 |
{ return __builtin_cosl(__x); } |
| 190 |
|
| 191 |
template<typename _Tp> |
| 192 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 193 |
double>::__type |
| 194 |
cos(_Tp __x) |
| 195 |
{ return __builtin_cos(__x); } |
| 196 |
|
| 197 |
using ::cosh; |
| 198 |
|
| 199 |
inline float |
| 200 |
cosh(float __x) |
| 201 |
{ return __builtin_coshf(__x); } |
| 202 |
|
| 203 |
inline long double |
| 204 |
cosh(long double __x) |
| 205 |
{ return __builtin_coshl(__x); } |
| 206 |
|
| 207 |
template<typename _Tp> |
| 208 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 209 |
double>::__type |
| 210 |
cosh(_Tp __x) |
| 211 |
{ return __builtin_cosh(__x); } |
| 212 |
|
| 213 |
using ::exp; |
| 214 |
|
| 215 |
inline float |
| 216 |
exp(float __x) |
| 217 |
{ return __builtin_expf(__x); } |
| 218 |
|
| 219 |
inline long double |
| 220 |
exp(long double __x) |
| 221 |
{ return __builtin_expl(__x); } |
| 222 |
|
| 223 |
template<typename _Tp> |
| 224 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 225 |
double>::__type |
| 226 |
exp(_Tp __x) |
| 227 |
{ return __builtin_exp(__x); } |
| 228 |
|
| 229 |
using ::fabs; |
| 230 |
|
| 231 |
inline float |
| 232 |
fabs(float __x) |
| 233 |
{ return __builtin_fabsf(__x); } |
| 234 |
|
| 235 |
inline long double |
| 236 |
fabs(long double __x) |
| 237 |
{ return __builtin_fabsl(__x); } |
| 238 |
|
| 239 |
template<typename _Tp> |
| 240 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 241 |
double>::__type |
| 242 |
fabs(_Tp __x) |
| 243 |
{ return __builtin_fabs(__x); } |
| 244 |
|
| 245 |
using ::floor; |
| 246 |
|
| 247 |
inline float |
| 248 |
floor(float __x) |
| 249 |
{ return __builtin_floorf(__x); } |
| 250 |
|
| 251 |
inline long double |
| 252 |
floor(long double __x) |
| 253 |
{ return __builtin_floorl(__x); } |
| 254 |
|
| 255 |
template<typename _Tp> |
| 256 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 257 |
double>::__type |
| 258 |
floor(_Tp __x) |
| 259 |
{ return __builtin_floor(__x); } |
| 260 |
|
| 261 |
using ::fmod; |
| 262 |
|
| 263 |
inline float |
| 264 |
fmod(float __x, float __y) |
| 265 |
{ return __builtin_fmodf(__x, __y); } |
| 266 |
|
| 267 |
inline long double |
| 268 |
fmod(long double __x, long double __y) |
| 269 |
{ return __builtin_fmodl(__x, __y); } |
| 270 |
|
| 271 |
template<typename _Tp, typename _Up> |
| 272 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value |
| 273 |
&& __is_integer<_Up>::__value, |
| 274 |
double>::__type |
| 275 |
fmod(_Tp __x, _Up __y) |
| 276 |
{ return __builtin_fmod(__x, __y); } |
| 277 |
|
| 278 |
using ::frexp; |
| 279 |
|
| 280 |
inline float |
| 281 |
frexp(float __x, int* __exp) |
| 282 |
{ return __builtin_frexpf(__x, __exp); } |
| 283 |
|
| 284 |
inline long double |
| 285 |
frexp(long double __x, int* __exp) |
| 286 |
{ return __builtin_frexpl(__x, __exp); } |
| 287 |
|
| 288 |
template<typename _Tp> |
| 289 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 290 |
double>::__type |
| 291 |
frexp(_Tp __x, int* __exp) |
| 292 |
{ return __builtin_frexp(__x, __exp); } |
| 293 |
|
| 294 |
using ::ldexp; |
| 295 |
|
| 296 |
inline float |
| 297 |
ldexp(float __x, int __exp) |
| 298 |
{ return __builtin_ldexpf(__x, __exp); } |
| 299 |
|
| 300 |
inline long double |
| 301 |
ldexp(long double __x, int __exp) |
| 302 |
{ return __builtin_ldexpl(__x, __exp); } |
| 303 |
|
| 304 |
template<typename _Tp> |
| 305 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 306 |
double>::__type |
| 307 |
ldexp(_Tp __x, int __exp) |
| 308 |
{ return __builtin_ldexp(__x, __exp); } |
| 309 |
|
| 310 |
using ::log; |
| 311 |
|
| 312 |
inline float |
| 313 |
log(float __x) |
| 314 |
{ return __builtin_logf(__x); } |
| 315 |
|
| 316 |
inline long double |
| 317 |
log(long double __x) |
| 318 |
{ return __builtin_logl(__x); } |
| 319 |
|
| 320 |
template<typename _Tp> |
| 321 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 322 |
double>::__type |
| 323 |
log(_Tp __x) |
| 324 |
{ return __builtin_log(__x); } |
| 325 |
|
| 326 |
using ::log10; |
| 327 |
|
| 328 |
inline float |
| 329 |
log10(float __x) |
| 330 |
{ return __builtin_log10f(__x); } |
| 331 |
|
| 332 |
inline long double |
| 333 |
log10(long double __x) |
| 334 |
{ return __builtin_log10l(__x); } |
| 335 |
|
| 336 |
template<typename _Tp> |
| 337 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 338 |
double>::__type |
| 339 |
log10(_Tp __x) |
| 340 |
{ return __builtin_log10(__x); } |
| 341 |
|
| 342 |
using ::modf; |
| 343 |
|
| 344 |
inline float |
| 345 |
modf(float __x, float* __iptr) |
| 346 |
{ return __builtin_modff(__x, __iptr); } |
| 347 |
|
| 348 |
inline long double |
| 349 |
modf(long double __x, long double* __iptr) |
| 350 |
{ return __builtin_modfl(__x, __iptr); } |
| 351 |
|
| 352 |
using ::pow; |
| 353 |
|
| 354 |
inline float |
| 355 |
pow(float __x, float __y) |
| 356 |
{ return __builtin_powf(__x, __y); } |
| 357 |
|
| 358 |
inline long double |
| 359 |
pow(long double __x, long double __y) |
| 360 |
{ return __builtin_powl(__x, __y); } |
| 361 |
|
| 362 |
inline double |
| 363 |
pow(double __x, int __i) |
| 364 |
{ return __builtin_powi(__x, __i); } |
| 365 |
|
| 366 |
inline float |
| 367 |
pow(float __x, int __n) |
| 368 |
{ return __builtin_powif(__x, __n); } |
| 369 |
|
| 370 |
inline long double |
| 371 |
pow(long double __x, int __n) |
| 372 |
{ return __builtin_powil(__x, __n); } |
| 373 |
|
| 374 |
using ::sin; |
| 375 |
|
| 376 |
inline float |
| 377 |
sin(float __x) |
| 378 |
{ return __builtin_sinf(__x); } |
| 379 |
|
| 380 |
inline long double |
| 381 |
sin(long double __x) |
| 382 |
{ return __builtin_sinl(__x); } |
| 383 |
|
| 384 |
template<typename _Tp> |
| 385 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 386 |
double>::__type |
| 387 |
sin(_Tp __x) |
| 388 |
{ return __builtin_sin(__x); } |
| 389 |
|
| 390 |
using ::sinh; |
| 391 |
|
| 392 |
inline float |
| 393 |
sinh(float __x) |
| 394 |
{ return __builtin_sinhf(__x); } |
| 395 |
|
| 396 |
inline long double |
| 397 |
sinh(long double __x) |
| 398 |
{ return __builtin_sinhl(__x); } |
| 399 |
|
| 400 |
template<typename _Tp> |
| 401 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 402 |
double>::__type |
| 403 |
sinh(_Tp __x) |
| 404 |
{ return __builtin_sinh(__x); } |
| 405 |
|
| 406 |
using ::sqrt; |
| 407 |
|
| 408 |
inline float |
| 409 |
sqrt(float __x) |
| 410 |
{ return __builtin_sqrtf(__x); } |
| 411 |
|
| 412 |
inline long double |
| 413 |
sqrt(long double __x) |
| 414 |
{ return __builtin_sqrtl(__x); } |
| 415 |
|
| 416 |
template<typename _Tp> |
| 417 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 418 |
double>::__type |
| 419 |
sqrt(_Tp __x) |
| 420 |
{ return __builtin_sqrt(__x); } |
| 421 |
|
| 422 |
using ::tan; |
| 423 |
|
| 424 |
inline float |
| 425 |
tan(float __x) |
| 426 |
{ return __builtin_tanf(__x); } |
| 427 |
|
| 428 |
inline long double |
| 429 |
tan(long double __x) |
| 430 |
{ return __builtin_tanl(__x); } |
| 431 |
|
| 432 |
template<typename _Tp> |
| 433 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 434 |
double>::__type |
| 435 |
tan(_Tp __x) |
| 436 |
{ return __builtin_tan(__x); } |
| 437 |
|
| 438 |
using ::tanh; |
| 439 |
|
| 440 |
inline float |
| 441 |
tanh(float __x) |
| 442 |
{ return __builtin_tanhf(__x); } |
| 443 |
|
| 444 |
inline long double |
| 445 |
tanh(long double __x) |
| 446 |
{ return __builtin_tanhl(__x); } |
| 447 |
|
| 448 |
template<typename _Tp> |
| 449 |
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, |
| 450 |
double>::__type |
| 451 |
tanh(_Tp __x) |
| 452 |
{ return __builtin_tanh(__x); } |
| 453 |
|
| 454 |
#if _GLIBCXX_USE_C99_MATH |
| 455 |
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC |
| 456 |
|
| 457 |
// These are possible macros imported from C99-land. |
| 458 |
#undef fpclassify |
| 459 |
#undef isfinite |
| 460 |
#undef isinf |
| 461 |
#undef isnan |
| 462 |
#undef isnormal |
| 463 |
#undef signbit |
| 464 |
#undef isgreater |
| 465 |
#undef isgreaterequal |
| 466 |
#undef isless |
| 467 |
#undef islessequal |
| 468 |
#undef islessgreater |
| 469 |
#undef isunordered |
| 470 |
|
| 471 |
template<typename _Tp> |
| 472 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 473 |
int>::__type |
| 474 |
fpclassify(_Tp __f) |
| 475 |
{ |
| 476 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 477 |
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, |
| 478 |
FP_SUBNORMAL, FP_ZERO, __type(__f)); |
| 479 |
} |
| 480 |
|
| 481 |
template<typename _Tp> |
| 482 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 483 |
int>::__type |
| 484 |
isfinite(_Tp __f) |
| 485 |
{ |
| 486 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 487 |
return __builtin_isfinite(__type(__f)); |
| 488 |
} |
| 489 |
|
| 490 |
template<typename _Tp> |
| 491 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 492 |
int>::__type |
| 493 |
isinf(_Tp __f) |
| 494 |
{ |
| 495 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 496 |
return __builtin_isinf(__type(__f)); |
| 497 |
} |
| 498 |
|
| 499 |
template<typename _Tp> |
| 500 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 501 |
int>::__type |
| 502 |
isnan(_Tp __f) |
| 503 |
{ |
| 504 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 505 |
return __builtin_isnan(__type(__f)); |
| 506 |
} |
| 507 |
|
| 508 |
template<typename _Tp> |
| 509 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 510 |
int>::__type |
| 511 |
isnormal(_Tp __f) |
| 512 |
{ |
| 513 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 514 |
return __builtin_isnormal(__type(__f)); |
| 515 |
} |
| 516 |
|
| 517 |
template<typename _Tp> |
| 518 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 519 |
int>::__type |
| 520 |
signbit(_Tp __f) |
| 521 |
{ |
| 522 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 523 |
return __builtin_signbit(__type(__f)); |
| 524 |
} |
| 525 |
|
| 526 |
template<typename _Tp> |
| 527 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 528 |
int>::__type |
| 529 |
isgreater(_Tp __f1, _Tp __f2) |
| 530 |
{ |
| 531 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 532 |
return __builtin_isgreater(__type(__f1), __type(__f2)); |
| 533 |
} |
| 534 |
|
| 535 |
template<typename _Tp> |
| 536 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 537 |
int>::__type |
| 538 |
isgreaterequal(_Tp __f1, _Tp __f2) |
| 539 |
{ |
| 540 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 541 |
return __builtin_isgreaterequal(__type(__f1), __type(__f2)); |
| 542 |
} |
| 543 |
|
| 544 |
template<typename _Tp> |
| 545 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 546 |
int>::__type |
| 547 |
isless(_Tp __f1, _Tp __f2) |
| 548 |
{ |
| 549 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 550 |
return __builtin_isless(__type(__f1), __type(__f2)); |
| 551 |
} |
| 552 |
|
| 553 |
template<typename _Tp> |
| 554 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 555 |
int>::__type |
| 556 |
islessequal(_Tp __f1, _Tp __f2) |
| 557 |
{ |
| 558 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 559 |
return __builtin_islessequal(__type(__f1), __type(__f2)); |
| 560 |
} |
| 561 |
|
| 562 |
template<typename _Tp> |
| 563 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 564 |
int>::__type |
| 565 |
islessgreater(_Tp __f1, _Tp __f2) |
| 566 |
{ |
| 567 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 568 |
return __builtin_islessgreater(__type(__f1), __type(__f2)); |
| 569 |
} |
| 570 |
|
| 571 |
template<typename _Tp> |
| 572 |
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value, |
| 573 |
int>::__type |
| 574 |
isunordered(_Tp __f1, _Tp __f2) |
| 575 |
{ |
| 576 |
typedef typename __gnu_cxx::__promote<_Tp>::__type __type; |
| 577 |
return __builtin_isunordered(__type(__f1), __type(__f2)); |
| 578 |
} |
| 579 |
|
| 580 |
#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */ |
| 581 |
#endif /* _GLIBCXX_USE_C99_MATH */ |
| 582 |
|
| 583 |
_GLIBCXX_END_NAMESPACE_VERSION |
| 584 |
} // namespace std |
| 585 |
|
| 586 |
#endif |