Warning, /include/c++/v1/__cxx03/cmath is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009
0010 #ifndef _LIBCPP___CXX03_CMATH
0011 #define _LIBCPP___CXX03_CMATH
0012
0013 /*
0014 cmath synopsis
0015
0016 Macros:
0017
0018 HUGE_VAL
0019 HUGE_VALF // C99
0020 HUGE_VALL // C99
0021 INFINITY // C99
0022 NAN // C99
0023 FP_INFINITE // C99
0024 FP_NAN // C99
0025 FP_NORMAL // C99
0026 FP_SUBNORMAL // C99
0027 FP_ZERO // C99
0028 FP_FAST_FMA // C99
0029 FP_FAST_FMAF // C99
0030 FP_FAST_FMAL // C99
0031 FP_ILOGB0 // C99
0032 FP_ILOGBNAN // C99
0033 MATH_ERRNO // C99
0034 MATH_ERREXCEPT // C99
0035 math_errhandling // C99
0036
0037 namespace std
0038 {
0039
0040 Types:
0041
0042 float_t // C99
0043 double_t // C99
0044
0045 // C90
0046
0047 floating_point abs(floating_point x);
0048
0049 floating_point acos (arithmetic x);
0050 float acosf(float x);
0051 long double acosl(long double x);
0052
0053 floating_point asin (arithmetic x);
0054 float asinf(float x);
0055 long double asinl(long double x);
0056
0057 floating_point atan (arithmetic x);
0058 float atanf(float x);
0059 long double atanl(long double x);
0060
0061 floating_point atan2 (arithmetic y, arithmetic x);
0062 float atan2f(float y, float x);
0063 long double atan2l(long double y, long double x);
0064
0065 floating_point ceil (arithmetic x);
0066 float ceilf(float x);
0067 long double ceill(long double x);
0068
0069 floating_point cos (arithmetic x);
0070 float cosf(float x);
0071 long double cosl(long double x);
0072
0073 floating_point cosh (arithmetic x);
0074 float coshf(float x);
0075 long double coshl(long double x);
0076
0077 floating_point exp (arithmetic x);
0078 float expf(float x);
0079 long double expl(long double x);
0080
0081 floating_point fabs (arithmetic x);
0082 float fabsf(float x);
0083 long double fabsl(long double x);
0084
0085 floating_point floor (arithmetic x);
0086 float floorf(float x);
0087 long double floorl(long double x);
0088
0089 floating_point fmod (arithmetic x, arithmetic y);
0090 float fmodf(float x, float y);
0091 long double fmodl(long double x, long double y);
0092
0093 floating_point frexp (arithmetic value, int* exp);
0094 float frexpf(float value, int* exp);
0095 long double frexpl(long double value, int* exp);
0096
0097 floating_point ldexp (arithmetic value, int exp);
0098 float ldexpf(float value, int exp);
0099 long double ldexpl(long double value, int exp);
0100
0101 floating_point log (arithmetic x);
0102 float logf(float x);
0103 long double logl(long double x);
0104
0105 floating_point log10 (arithmetic x);
0106 float log10f(float x);
0107 long double log10l(long double x);
0108
0109 floating_point modf (floating_point value, floating_point* iptr);
0110 float modff(float value, float* iptr);
0111 long double modfl(long double value, long double* iptr);
0112
0113 floating_point pow (arithmetic x, arithmetic y);
0114 float powf(float x, float y);
0115 long double powl(long double x, long double y);
0116
0117 floating_point sin (arithmetic x);
0118 float sinf(float x);
0119 long double sinl(long double x);
0120
0121 floating_point sinh (arithmetic x);
0122 float sinhf(float x);
0123 long double sinhl(long double x);
0124
0125 floating_point sqrt (arithmetic x);
0126 float sqrtf(float x);
0127 long double sqrtl(long double x);
0128
0129 floating_point tan (arithmetic x);
0130 float tanf(float x);
0131 long double tanl(long double x);
0132
0133 floating_point tanh (arithmetic x);
0134 float tanhf(float x);
0135 long double tanhl(long double x);
0136
0137 // C99
0138
0139 bool signbit(arithmetic x);
0140
0141 int fpclassify(arithmetic x);
0142
0143 bool isfinite(arithmetic x);
0144 bool isinf(arithmetic x);
0145 bool isnan(arithmetic x);
0146 bool isnormal(arithmetic x);
0147
0148 bool isgreater(arithmetic x, arithmetic y);
0149 bool isgreaterequal(arithmetic x, arithmetic y);
0150 bool isless(arithmetic x, arithmetic y);
0151 bool islessequal(arithmetic x, arithmetic y);
0152 bool islessgreater(arithmetic x, arithmetic y);
0153 bool isunordered(arithmetic x, arithmetic y);
0154
0155 floating_point acosh (arithmetic x);
0156 float acoshf(float x);
0157 long double acoshl(long double x);
0158
0159 floating_point asinh (arithmetic x);
0160 float asinhf(float x);
0161 long double asinhl(long double x);
0162
0163 floating_point atanh (arithmetic x);
0164 float atanhf(float x);
0165 long double atanhl(long double x);
0166
0167 floating_point cbrt (arithmetic x);
0168 float cbrtf(float x);
0169 long double cbrtl(long double x);
0170
0171 floating_point copysign (arithmetic x, arithmetic y);
0172 float copysignf(float x, float y);
0173 long double copysignl(long double x, long double y);
0174
0175 floating_point erf (arithmetic x);
0176 float erff(float x);
0177 long double erfl(long double x);
0178
0179 floating_point erfc (arithmetic x);
0180 float erfcf(float x);
0181 long double erfcl(long double x);
0182
0183 floating_point exp2 (arithmetic x);
0184 float exp2f(float x);
0185 long double exp2l(long double x);
0186
0187 floating_point expm1 (arithmetic x);
0188 float expm1f(float x);
0189 long double expm1l(long double x);
0190
0191 floating_point fdim (arithmetic x, arithmetic y);
0192 float fdimf(float x, float y);
0193 long double fdiml(long double x, long double y);
0194
0195 floating_point fma (arithmetic x, arithmetic y, arithmetic z);
0196 float fmaf(float x, float y, float z);
0197 long double fmal(long double x, long double y, long double z);
0198
0199 floating_point fmax (arithmetic x, arithmetic y);
0200 float fmaxf(float x, float y);
0201 long double fmaxl(long double x, long double y);
0202
0203 floating_point fmin (arithmetic x, arithmetic y);
0204 float fminf(float x, float y);
0205 long double fminl(long double x, long double y);
0206
0207 double hermite(unsigned n, double x); // C++17
0208 float hermite(unsigned n, float x); // C++17
0209 long double hermite(unsigned n, long double x); // C++17
0210 float hermitef(unsigned n, float x); // C++17
0211 long double hermitel(unsigned n, long double x); // C++17
0212 template <class Integer>
0213 double hermite(unsigned n, Integer x); // C++17
0214
0215 floating_point hypot (arithmetic x, arithmetic y);
0216 float hypotf(float x, float y);
0217 long double hypotl(long double x, long double y);
0218
0219 double hypot(double x, double y, double z); // C++17
0220 float hypot(float x, float y, float z); // C++17
0221 long double hypot(long double x, long double y, long double z); // C++17
0222
0223 int ilogb (arithmetic x);
0224 int ilogbf(float x);
0225 int ilogbl(long double x);
0226
0227 floating_point lgamma (arithmetic x);
0228 float lgammaf(float x);
0229 long double lgammal(long double x);
0230
0231 long long llrint (arithmetic x);
0232 long long llrintf(float x);
0233 long long llrintl(long double x);
0234
0235 long long llround (arithmetic x);
0236 long long llroundf(float x);
0237 long long llroundl(long double x);
0238
0239 floating_point log1p (arithmetic x);
0240 float log1pf(float x);
0241 long double log1pl(long double x);
0242
0243 floating_point log2 (arithmetic x);
0244 float log2f(float x);
0245 long double log2l(long double x);
0246
0247 floating_point logb (arithmetic x);
0248 float logbf(float x);
0249 long double logbl(long double x);
0250
0251 long lrint (arithmetic x);
0252 long lrintf(float x);
0253 long lrintl(long double x);
0254
0255 long lround (arithmetic x);
0256 long lroundf(float x);
0257 long lroundl(long double x);
0258
0259 double nan (const char* str);
0260 float nanf(const char* str);
0261 long double nanl(const char* str);
0262
0263 floating_point nearbyint (arithmetic x);
0264 float nearbyintf(float x);
0265 long double nearbyintl(long double x);
0266
0267 floating_point nextafter (arithmetic x, arithmetic y);
0268 float nextafterf(float x, float y);
0269 long double nextafterl(long double x, long double y);
0270
0271 floating_point nexttoward (arithmetic x, long double y);
0272 float nexttowardf(float x, long double y);
0273 long double nexttowardl(long double x, long double y);
0274
0275 floating_point remainder (arithmetic x, arithmetic y);
0276 float remainderf(float x, float y);
0277 long double remainderl(long double x, long double y);
0278
0279 floating_point remquo (arithmetic x, arithmetic y, int* pquo);
0280 float remquof(float x, float y, int* pquo);
0281 long double remquol(long double x, long double y, int* pquo);
0282
0283 floating_point rint (arithmetic x);
0284 float rintf(float x);
0285 long double rintl(long double x);
0286
0287 floating_point round (arithmetic x);
0288 float roundf(float x);
0289 long double roundl(long double x);
0290
0291 floating_point scalbln (arithmetic x, long ex);
0292 float scalblnf(float x, long ex);
0293 long double scalblnl(long double x, long ex);
0294
0295 floating_point scalbn (arithmetic x, int ex);
0296 float scalbnf(float x, int ex);
0297 long double scalbnl(long double x, int ex);
0298
0299 floating_point tgamma (arithmetic x);
0300 float tgammaf(float x);
0301 long double tgammal(long double x);
0302
0303 floating_point trunc (arithmetic x);
0304 float truncf(float x);
0305 long double truncl(long double x);
0306
0307 constexpr float lerp(float a, float b, float t) noexcept; // C++20
0308 constexpr double lerp(double a, double b, double t) noexcept; // C++20
0309 constexpr long double lerp(long double a, long double b, long double t) noexcept; // C++20
0310
0311 } // std
0312
0313 */
0314
0315 #include <__cxx03/__config>
0316 #include <__cxx03/__math/hypot.h>
0317 #include <__cxx03/__type_traits/enable_if.h>
0318 #include <__cxx03/__type_traits/is_arithmetic.h>
0319 #include <__cxx03/__type_traits/is_constant_evaluated.h>
0320 #include <__cxx03/__type_traits/is_floating_point.h>
0321 #include <__cxx03/__type_traits/is_same.h>
0322 #include <__cxx03/__type_traits/promote.h>
0323 #include <__cxx03/__type_traits/remove_cv.h>
0324 #include <__cxx03/limits>
0325 #include <__cxx03/version>
0326
0327 #include <__cxx03/__math/special_functions.h>
0328 #include <__cxx03/math.h>
0329
0330 #ifndef _LIBCPP___CXX03_MATH_H
0331 # error <cmath> tried including <math.h> but didn't find libc++'s <math.h> header. \
0332 This usually means that your header search paths are not configured properly. \
0333 The header search paths should contain the C++ Standard Library headers before \
0334 any C Standard Library, and you are probably using compiler flags that make that \
0335 not be the case.
0336 #endif
0337
0338 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0339 # pragma GCC system_header
0340 #endif
0341
0342 _LIBCPP_PUSH_MACROS
0343 #include <__cxx03/__undef_macros>
0344
0345 _LIBCPP_BEGIN_NAMESPACE_STD
0346
0347 using ::signbit _LIBCPP_USING_IF_EXISTS;
0348 using ::fpclassify _LIBCPP_USING_IF_EXISTS;
0349 using ::isfinite _LIBCPP_USING_IF_EXISTS;
0350 using ::isinf _LIBCPP_USING_IF_EXISTS;
0351 using ::isnan _LIBCPP_USING_IF_EXISTS;
0352 using ::isnormal _LIBCPP_USING_IF_EXISTS;
0353 using ::isgreater _LIBCPP_USING_IF_EXISTS;
0354 using ::isgreaterequal _LIBCPP_USING_IF_EXISTS;
0355 using ::isless _LIBCPP_USING_IF_EXISTS;
0356 using ::islessequal _LIBCPP_USING_IF_EXISTS;
0357 using ::islessgreater _LIBCPP_USING_IF_EXISTS;
0358 using ::isunordered _LIBCPP_USING_IF_EXISTS;
0359 using ::isunordered _LIBCPP_USING_IF_EXISTS;
0360
0361 using ::float_t _LIBCPP_USING_IF_EXISTS;
0362 using ::double_t _LIBCPP_USING_IF_EXISTS;
0363
0364 using ::abs _LIBCPP_USING_IF_EXISTS;
0365
0366 using ::acos _LIBCPP_USING_IF_EXISTS;
0367 using ::acosf _LIBCPP_USING_IF_EXISTS;
0368 using ::asin _LIBCPP_USING_IF_EXISTS;
0369 using ::asinf _LIBCPP_USING_IF_EXISTS;
0370 using ::atan _LIBCPP_USING_IF_EXISTS;
0371 using ::atanf _LIBCPP_USING_IF_EXISTS;
0372 using ::atan2 _LIBCPP_USING_IF_EXISTS;
0373 using ::atan2f _LIBCPP_USING_IF_EXISTS;
0374 using ::ceil _LIBCPP_USING_IF_EXISTS;
0375 using ::ceilf _LIBCPP_USING_IF_EXISTS;
0376 using ::cos _LIBCPP_USING_IF_EXISTS;
0377 using ::cosf _LIBCPP_USING_IF_EXISTS;
0378 using ::cosh _LIBCPP_USING_IF_EXISTS;
0379 using ::coshf _LIBCPP_USING_IF_EXISTS;
0380
0381 using ::exp _LIBCPP_USING_IF_EXISTS;
0382 using ::expf _LIBCPP_USING_IF_EXISTS;
0383
0384 using ::fabs _LIBCPP_USING_IF_EXISTS;
0385 using ::fabsf _LIBCPP_USING_IF_EXISTS;
0386 using ::floor _LIBCPP_USING_IF_EXISTS;
0387 using ::floorf _LIBCPP_USING_IF_EXISTS;
0388
0389 using ::fmod _LIBCPP_USING_IF_EXISTS;
0390 using ::fmodf _LIBCPP_USING_IF_EXISTS;
0391
0392 using ::frexp _LIBCPP_USING_IF_EXISTS;
0393 using ::frexpf _LIBCPP_USING_IF_EXISTS;
0394 using ::ldexp _LIBCPP_USING_IF_EXISTS;
0395 using ::ldexpf _LIBCPP_USING_IF_EXISTS;
0396
0397 using ::log _LIBCPP_USING_IF_EXISTS;
0398 using ::logf _LIBCPP_USING_IF_EXISTS;
0399
0400 using ::log10 _LIBCPP_USING_IF_EXISTS;
0401 using ::log10f _LIBCPP_USING_IF_EXISTS;
0402 using ::modf _LIBCPP_USING_IF_EXISTS;
0403 using ::modff _LIBCPP_USING_IF_EXISTS;
0404
0405 using ::pow _LIBCPP_USING_IF_EXISTS;
0406 using ::powf _LIBCPP_USING_IF_EXISTS;
0407
0408 using ::sin _LIBCPP_USING_IF_EXISTS;
0409 using ::sinf _LIBCPP_USING_IF_EXISTS;
0410 using ::sinh _LIBCPP_USING_IF_EXISTS;
0411 using ::sinhf _LIBCPP_USING_IF_EXISTS;
0412
0413 using ::sqrt _LIBCPP_USING_IF_EXISTS;
0414 using ::sqrtf _LIBCPP_USING_IF_EXISTS;
0415 using ::tan _LIBCPP_USING_IF_EXISTS;
0416 using ::tanf _LIBCPP_USING_IF_EXISTS;
0417
0418 using ::tanh _LIBCPP_USING_IF_EXISTS;
0419 using ::tanhf _LIBCPP_USING_IF_EXISTS;
0420
0421 using ::acosh _LIBCPP_USING_IF_EXISTS;
0422 using ::acoshf _LIBCPP_USING_IF_EXISTS;
0423 using ::asinh _LIBCPP_USING_IF_EXISTS;
0424 using ::asinhf _LIBCPP_USING_IF_EXISTS;
0425 using ::atanh _LIBCPP_USING_IF_EXISTS;
0426 using ::atanhf _LIBCPP_USING_IF_EXISTS;
0427 using ::cbrt _LIBCPP_USING_IF_EXISTS;
0428 using ::cbrtf _LIBCPP_USING_IF_EXISTS;
0429
0430 using ::copysign _LIBCPP_USING_IF_EXISTS;
0431 using ::copysignf _LIBCPP_USING_IF_EXISTS;
0432
0433 using ::erf _LIBCPP_USING_IF_EXISTS;
0434 using ::erff _LIBCPP_USING_IF_EXISTS;
0435 using ::erfc _LIBCPP_USING_IF_EXISTS;
0436 using ::erfcf _LIBCPP_USING_IF_EXISTS;
0437 using ::exp2 _LIBCPP_USING_IF_EXISTS;
0438 using ::exp2f _LIBCPP_USING_IF_EXISTS;
0439 using ::expm1 _LIBCPP_USING_IF_EXISTS;
0440 using ::expm1f _LIBCPP_USING_IF_EXISTS;
0441 using ::fdim _LIBCPP_USING_IF_EXISTS;
0442 using ::fdimf _LIBCPP_USING_IF_EXISTS;
0443 using ::fmaf _LIBCPP_USING_IF_EXISTS;
0444 using ::fma _LIBCPP_USING_IF_EXISTS;
0445 using ::fmax _LIBCPP_USING_IF_EXISTS;
0446 using ::fmaxf _LIBCPP_USING_IF_EXISTS;
0447 using ::fmin _LIBCPP_USING_IF_EXISTS;
0448 using ::fminf _LIBCPP_USING_IF_EXISTS;
0449 using ::hypot _LIBCPP_USING_IF_EXISTS;
0450 using ::hypotf _LIBCPP_USING_IF_EXISTS;
0451 using ::ilogb _LIBCPP_USING_IF_EXISTS;
0452 using ::ilogbf _LIBCPP_USING_IF_EXISTS;
0453 using ::lgamma _LIBCPP_USING_IF_EXISTS;
0454 using ::lgammaf _LIBCPP_USING_IF_EXISTS;
0455 using ::llrint _LIBCPP_USING_IF_EXISTS;
0456 using ::llrintf _LIBCPP_USING_IF_EXISTS;
0457 using ::llround _LIBCPP_USING_IF_EXISTS;
0458 using ::llroundf _LIBCPP_USING_IF_EXISTS;
0459 using ::log1p _LIBCPP_USING_IF_EXISTS;
0460 using ::log1pf _LIBCPP_USING_IF_EXISTS;
0461 using ::log2 _LIBCPP_USING_IF_EXISTS;
0462 using ::log2f _LIBCPP_USING_IF_EXISTS;
0463 using ::logb _LIBCPP_USING_IF_EXISTS;
0464 using ::logbf _LIBCPP_USING_IF_EXISTS;
0465 using ::lrint _LIBCPP_USING_IF_EXISTS;
0466 using ::lrintf _LIBCPP_USING_IF_EXISTS;
0467 using ::lround _LIBCPP_USING_IF_EXISTS;
0468 using ::lroundf _LIBCPP_USING_IF_EXISTS;
0469
0470 using ::nan _LIBCPP_USING_IF_EXISTS;
0471 using ::nanf _LIBCPP_USING_IF_EXISTS;
0472
0473 using ::nearbyint _LIBCPP_USING_IF_EXISTS;
0474 using ::nearbyintf _LIBCPP_USING_IF_EXISTS;
0475 using ::nextafter _LIBCPP_USING_IF_EXISTS;
0476 using ::nextafterf _LIBCPP_USING_IF_EXISTS;
0477 using ::nexttoward _LIBCPP_USING_IF_EXISTS;
0478 using ::nexttowardf _LIBCPP_USING_IF_EXISTS;
0479 using ::remainder _LIBCPP_USING_IF_EXISTS;
0480 using ::remainderf _LIBCPP_USING_IF_EXISTS;
0481 using ::remquo _LIBCPP_USING_IF_EXISTS;
0482 using ::remquof _LIBCPP_USING_IF_EXISTS;
0483 using ::rint _LIBCPP_USING_IF_EXISTS;
0484 using ::rintf _LIBCPP_USING_IF_EXISTS;
0485 using ::round _LIBCPP_USING_IF_EXISTS;
0486 using ::roundf _LIBCPP_USING_IF_EXISTS;
0487 using ::scalbln _LIBCPP_USING_IF_EXISTS;
0488 using ::scalblnf _LIBCPP_USING_IF_EXISTS;
0489 using ::scalbn _LIBCPP_USING_IF_EXISTS;
0490 using ::scalbnf _LIBCPP_USING_IF_EXISTS;
0491 using ::tgamma _LIBCPP_USING_IF_EXISTS;
0492 using ::tgammaf _LIBCPP_USING_IF_EXISTS;
0493 using ::trunc _LIBCPP_USING_IF_EXISTS;
0494 using ::truncf _LIBCPP_USING_IF_EXISTS;
0495
0496 using ::acosl _LIBCPP_USING_IF_EXISTS;
0497 using ::asinl _LIBCPP_USING_IF_EXISTS;
0498 using ::atanl _LIBCPP_USING_IF_EXISTS;
0499 using ::atan2l _LIBCPP_USING_IF_EXISTS;
0500 using ::ceill _LIBCPP_USING_IF_EXISTS;
0501 using ::cosl _LIBCPP_USING_IF_EXISTS;
0502 using ::coshl _LIBCPP_USING_IF_EXISTS;
0503 using ::expl _LIBCPP_USING_IF_EXISTS;
0504 using ::fabsl _LIBCPP_USING_IF_EXISTS;
0505 using ::floorl _LIBCPP_USING_IF_EXISTS;
0506 using ::fmodl _LIBCPP_USING_IF_EXISTS;
0507 using ::frexpl _LIBCPP_USING_IF_EXISTS;
0508 using ::ldexpl _LIBCPP_USING_IF_EXISTS;
0509 using ::logl _LIBCPP_USING_IF_EXISTS;
0510 using ::log10l _LIBCPP_USING_IF_EXISTS;
0511 using ::modfl _LIBCPP_USING_IF_EXISTS;
0512 using ::powl _LIBCPP_USING_IF_EXISTS;
0513 using ::sinl _LIBCPP_USING_IF_EXISTS;
0514 using ::sinhl _LIBCPP_USING_IF_EXISTS;
0515 using ::sqrtl _LIBCPP_USING_IF_EXISTS;
0516 using ::tanl _LIBCPP_USING_IF_EXISTS;
0517
0518 using ::tanhl _LIBCPP_USING_IF_EXISTS;
0519 using ::acoshl _LIBCPP_USING_IF_EXISTS;
0520 using ::asinhl _LIBCPP_USING_IF_EXISTS;
0521 using ::atanhl _LIBCPP_USING_IF_EXISTS;
0522 using ::cbrtl _LIBCPP_USING_IF_EXISTS;
0523
0524 using ::copysignl _LIBCPP_USING_IF_EXISTS;
0525
0526 using ::erfl _LIBCPP_USING_IF_EXISTS;
0527 using ::erfcl _LIBCPP_USING_IF_EXISTS;
0528 using ::exp2l _LIBCPP_USING_IF_EXISTS;
0529 using ::expm1l _LIBCPP_USING_IF_EXISTS;
0530 using ::fdiml _LIBCPP_USING_IF_EXISTS;
0531 using ::fmal _LIBCPP_USING_IF_EXISTS;
0532 using ::fmaxl _LIBCPP_USING_IF_EXISTS;
0533 using ::fminl _LIBCPP_USING_IF_EXISTS;
0534 using ::hypotl _LIBCPP_USING_IF_EXISTS;
0535 using ::ilogbl _LIBCPP_USING_IF_EXISTS;
0536 using ::lgammal _LIBCPP_USING_IF_EXISTS;
0537 using ::llrintl _LIBCPP_USING_IF_EXISTS;
0538 using ::llroundl _LIBCPP_USING_IF_EXISTS;
0539 using ::log1pl _LIBCPP_USING_IF_EXISTS;
0540 using ::log2l _LIBCPP_USING_IF_EXISTS;
0541 using ::logbl _LIBCPP_USING_IF_EXISTS;
0542 using ::lrintl _LIBCPP_USING_IF_EXISTS;
0543 using ::lroundl _LIBCPP_USING_IF_EXISTS;
0544 using ::nanl _LIBCPP_USING_IF_EXISTS;
0545 using ::nearbyintl _LIBCPP_USING_IF_EXISTS;
0546 using ::nextafterl _LIBCPP_USING_IF_EXISTS;
0547 using ::nexttowardl _LIBCPP_USING_IF_EXISTS;
0548 using ::remainderl _LIBCPP_USING_IF_EXISTS;
0549 using ::remquol _LIBCPP_USING_IF_EXISTS;
0550 using ::rintl _LIBCPP_USING_IF_EXISTS;
0551 using ::roundl _LIBCPP_USING_IF_EXISTS;
0552 using ::scalblnl _LIBCPP_USING_IF_EXISTS;
0553 using ::scalbnl _LIBCPP_USING_IF_EXISTS;
0554 using ::tgammal _LIBCPP_USING_IF_EXISTS;
0555 using ::truncl _LIBCPP_USING_IF_EXISTS;
0556
0557 template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
0558 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT {
0559 #if __has_builtin(__builtin_isnan)
0560 return __builtin_isnan(__lcpp_x);
0561 #else
0562 return isnan(__lcpp_x);
0563 #endif
0564 }
0565
0566 template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
0567 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT {
0568 return std::isnan(__lcpp_x);
0569 }
0570
0571 template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
0572 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT {
0573 #if __has_builtin(__builtin_isinf)
0574 return __builtin_isinf(__lcpp_x);
0575 #else
0576 return isinf(__lcpp_x);
0577 #endif
0578 }
0579
0580 template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
0581 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT {
0582 return std::isinf(__lcpp_x);
0583 }
0584
0585 template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
0586 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT {
0587 #if __has_builtin(__builtin_isfinite)
0588 return __builtin_isfinite(__lcpp_x);
0589 #else
0590 return isfinite(__lcpp_x);
0591 #endif
0592 }
0593
0594 template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
0595 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT {
0596 return __builtin_isfinite(__lcpp_x);
0597 }
0598
0599 #if _LIBCPP_STD_VER >= 20
0600 template <typename _Fp>
0601 _LIBCPP_HIDE_FROM_ABI constexpr _Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept {
0602 if ((__a <= 0 && __b >= 0) || (__a >= 0 && __b <= 0))
0603 return __t * __b + (1 - __t) * __a;
0604
0605 if (__t == 1)
0606 return __b;
0607 const _Fp __x = __a + __t * (__b - __a);
0608 if ((__t > 1) == (__b > __a))
0609 return __b < __x ? __x : __b;
0610 else
0611 return __x < __b ? __x : __b;
0612 }
0613
0614 _LIBCPP_HIDE_FROM_ABI inline constexpr float lerp(float __a, float __b, float __t) _NOEXCEPT {
0615 return __lerp(__a, __b, __t);
0616 }
0617
0618 _LIBCPP_HIDE_FROM_ABI inline constexpr double lerp(double __a, double __b, double __t) _NOEXCEPT {
0619 return __lerp(__a, __b, __t);
0620 }
0621
0622 _LIBCPP_HIDE_FROM_ABI inline constexpr long double lerp(long double __a, long double __b, long double __t) _NOEXCEPT {
0623 return __lerp(__a, __b, __t);
0624 }
0625
0626 template <class _A1, class _A2, class _A3>
0627 inline _LIBCPP_HIDE_FROM_ABI constexpr
0628 typename enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value && is_arithmetic<_A3>::value,
0629 __promote<_A1, _A2, _A3> >::type
0630 lerp(_A1 __a, _A2 __b, _A3 __t) noexcept {
0631 typedef typename __promote<_A1, _A2, _A3>::type __result_type;
0632 static_assert(!(
0633 _IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value && _IsSame<_A3, __result_type>::value));
0634 return std::__lerp((__result_type)__a, (__result_type)__b, (__result_type)__t);
0635 }
0636 #endif // _LIBCPP_STD_VER >= 20
0637
0638 _LIBCPP_END_NAMESPACE_STD
0639
0640 _LIBCPP_POP_MACROS
0641
0642 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0643 # include <__cxx03/type_traits>
0644 #endif
0645
0646 #endif // _LIBCPP___CXX03_CMATH