Warning, /include/c++/v1/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_CMATH
0011 #define _LIBCPP_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 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0316 # include <__cxx03/cmath>
0317 #else
0318 # include <__config>
0319 # include <__math/hypot.h>
0320 # include <__type_traits/enable_if.h>
0321 # include <__type_traits/is_arithmetic.h>
0322 # include <__type_traits/is_constant_evaluated.h>
0323 # include <__type_traits/is_floating_point.h>
0324 # include <__type_traits/is_same.h>
0325 # include <__type_traits/promote.h>
0326 # include <__type_traits/remove_cv.h>
0327 # include <limits>
0328 # include <version>
0329
0330 # include <__math/special_functions.h>
0331 # include <math.h>
0332
0333 # ifndef _LIBCPP_MATH_H
0334 # error <cmath> tried including <math.h> but didn't find libc++'s <math.h> header. \
0335 This usually means that your header search paths are not configured properly. \
0336 The header search paths should contain the C++ Standard Library headers before \
0337 any C Standard Library, and you are probably using compiler flags that make that \
0338 not be the case.
0339 # endif
0340
0341 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0342 # pragma GCC system_header
0343 # endif
0344
0345 _LIBCPP_PUSH_MACROS
0346 # include <__undef_macros>
0347
0348 _LIBCPP_BEGIN_NAMESPACE_STD
0349
0350 using ::signbit _LIBCPP_USING_IF_EXISTS;
0351 using ::fpclassify _LIBCPP_USING_IF_EXISTS;
0352 using ::isfinite _LIBCPP_USING_IF_EXISTS;
0353 using ::isinf _LIBCPP_USING_IF_EXISTS;
0354 using ::isnan _LIBCPP_USING_IF_EXISTS;
0355 using ::isnormal _LIBCPP_USING_IF_EXISTS;
0356 using ::isgreater _LIBCPP_USING_IF_EXISTS;
0357 using ::isgreaterequal _LIBCPP_USING_IF_EXISTS;
0358 using ::isless _LIBCPP_USING_IF_EXISTS;
0359 using ::islessequal _LIBCPP_USING_IF_EXISTS;
0360 using ::islessgreater _LIBCPP_USING_IF_EXISTS;
0361 using ::isunordered _LIBCPP_USING_IF_EXISTS;
0362 using ::isunordered _LIBCPP_USING_IF_EXISTS;
0363
0364 using ::float_t _LIBCPP_USING_IF_EXISTS;
0365 using ::double_t _LIBCPP_USING_IF_EXISTS;
0366
0367 using ::abs _LIBCPP_USING_IF_EXISTS;
0368
0369 using ::acos _LIBCPP_USING_IF_EXISTS;
0370 using ::acosf _LIBCPP_USING_IF_EXISTS;
0371 using ::asin _LIBCPP_USING_IF_EXISTS;
0372 using ::asinf _LIBCPP_USING_IF_EXISTS;
0373 using ::atan _LIBCPP_USING_IF_EXISTS;
0374 using ::atanf _LIBCPP_USING_IF_EXISTS;
0375 using ::atan2 _LIBCPP_USING_IF_EXISTS;
0376 using ::atan2f _LIBCPP_USING_IF_EXISTS;
0377 using ::ceil _LIBCPP_USING_IF_EXISTS;
0378 using ::ceilf _LIBCPP_USING_IF_EXISTS;
0379 using ::cos _LIBCPP_USING_IF_EXISTS;
0380 using ::cosf _LIBCPP_USING_IF_EXISTS;
0381 using ::cosh _LIBCPP_USING_IF_EXISTS;
0382 using ::coshf _LIBCPP_USING_IF_EXISTS;
0383
0384 using ::exp _LIBCPP_USING_IF_EXISTS;
0385 using ::expf _LIBCPP_USING_IF_EXISTS;
0386
0387 using ::fabs _LIBCPP_USING_IF_EXISTS;
0388 using ::fabsf _LIBCPP_USING_IF_EXISTS;
0389 using ::floor _LIBCPP_USING_IF_EXISTS;
0390 using ::floorf _LIBCPP_USING_IF_EXISTS;
0391
0392 using ::fmod _LIBCPP_USING_IF_EXISTS;
0393 using ::fmodf _LIBCPP_USING_IF_EXISTS;
0394
0395 using ::frexp _LIBCPP_USING_IF_EXISTS;
0396 using ::frexpf _LIBCPP_USING_IF_EXISTS;
0397 using ::ldexp _LIBCPP_USING_IF_EXISTS;
0398 using ::ldexpf _LIBCPP_USING_IF_EXISTS;
0399
0400 using ::log _LIBCPP_USING_IF_EXISTS;
0401 using ::logf _LIBCPP_USING_IF_EXISTS;
0402
0403 using ::log10 _LIBCPP_USING_IF_EXISTS;
0404 using ::log10f _LIBCPP_USING_IF_EXISTS;
0405 using ::modf _LIBCPP_USING_IF_EXISTS;
0406 using ::modff _LIBCPP_USING_IF_EXISTS;
0407
0408 using ::pow _LIBCPP_USING_IF_EXISTS;
0409 using ::powf _LIBCPP_USING_IF_EXISTS;
0410
0411 using ::sin _LIBCPP_USING_IF_EXISTS;
0412 using ::sinf _LIBCPP_USING_IF_EXISTS;
0413 using ::sinh _LIBCPP_USING_IF_EXISTS;
0414 using ::sinhf _LIBCPP_USING_IF_EXISTS;
0415
0416 using ::sqrt _LIBCPP_USING_IF_EXISTS;
0417 using ::sqrtf _LIBCPP_USING_IF_EXISTS;
0418 using ::tan _LIBCPP_USING_IF_EXISTS;
0419 using ::tanf _LIBCPP_USING_IF_EXISTS;
0420
0421 using ::tanh _LIBCPP_USING_IF_EXISTS;
0422 using ::tanhf _LIBCPP_USING_IF_EXISTS;
0423
0424 using ::acosh _LIBCPP_USING_IF_EXISTS;
0425 using ::acoshf _LIBCPP_USING_IF_EXISTS;
0426 using ::asinh _LIBCPP_USING_IF_EXISTS;
0427 using ::asinhf _LIBCPP_USING_IF_EXISTS;
0428 using ::atanh _LIBCPP_USING_IF_EXISTS;
0429 using ::atanhf _LIBCPP_USING_IF_EXISTS;
0430 using ::cbrt _LIBCPP_USING_IF_EXISTS;
0431 using ::cbrtf _LIBCPP_USING_IF_EXISTS;
0432
0433 using ::copysign _LIBCPP_USING_IF_EXISTS;
0434 using ::copysignf _LIBCPP_USING_IF_EXISTS;
0435
0436 using ::erf _LIBCPP_USING_IF_EXISTS;
0437 using ::erff _LIBCPP_USING_IF_EXISTS;
0438 using ::erfc _LIBCPP_USING_IF_EXISTS;
0439 using ::erfcf _LIBCPP_USING_IF_EXISTS;
0440 using ::exp2 _LIBCPP_USING_IF_EXISTS;
0441 using ::exp2f _LIBCPP_USING_IF_EXISTS;
0442 using ::expm1 _LIBCPP_USING_IF_EXISTS;
0443 using ::expm1f _LIBCPP_USING_IF_EXISTS;
0444 using ::fdim _LIBCPP_USING_IF_EXISTS;
0445 using ::fdimf _LIBCPP_USING_IF_EXISTS;
0446 using ::fmaf _LIBCPP_USING_IF_EXISTS;
0447 using ::fma _LIBCPP_USING_IF_EXISTS;
0448 using ::fmax _LIBCPP_USING_IF_EXISTS;
0449 using ::fmaxf _LIBCPP_USING_IF_EXISTS;
0450 using ::fmin _LIBCPP_USING_IF_EXISTS;
0451 using ::fminf _LIBCPP_USING_IF_EXISTS;
0452 using ::hypot _LIBCPP_USING_IF_EXISTS;
0453 using ::hypotf _LIBCPP_USING_IF_EXISTS;
0454 using ::ilogb _LIBCPP_USING_IF_EXISTS;
0455 using ::ilogbf _LIBCPP_USING_IF_EXISTS;
0456 using ::lgamma _LIBCPP_USING_IF_EXISTS;
0457 using ::lgammaf _LIBCPP_USING_IF_EXISTS;
0458 using ::llrint _LIBCPP_USING_IF_EXISTS;
0459 using ::llrintf _LIBCPP_USING_IF_EXISTS;
0460 using ::llround _LIBCPP_USING_IF_EXISTS;
0461 using ::llroundf _LIBCPP_USING_IF_EXISTS;
0462 using ::log1p _LIBCPP_USING_IF_EXISTS;
0463 using ::log1pf _LIBCPP_USING_IF_EXISTS;
0464 using ::log2 _LIBCPP_USING_IF_EXISTS;
0465 using ::log2f _LIBCPP_USING_IF_EXISTS;
0466 using ::logb _LIBCPP_USING_IF_EXISTS;
0467 using ::logbf _LIBCPP_USING_IF_EXISTS;
0468 using ::lrint _LIBCPP_USING_IF_EXISTS;
0469 using ::lrintf _LIBCPP_USING_IF_EXISTS;
0470 using ::lround _LIBCPP_USING_IF_EXISTS;
0471 using ::lroundf _LIBCPP_USING_IF_EXISTS;
0472
0473 using ::nan _LIBCPP_USING_IF_EXISTS;
0474 using ::nanf _LIBCPP_USING_IF_EXISTS;
0475
0476 using ::nearbyint _LIBCPP_USING_IF_EXISTS;
0477 using ::nearbyintf _LIBCPP_USING_IF_EXISTS;
0478 using ::nextafter _LIBCPP_USING_IF_EXISTS;
0479 using ::nextafterf _LIBCPP_USING_IF_EXISTS;
0480 using ::nexttoward _LIBCPP_USING_IF_EXISTS;
0481 using ::nexttowardf _LIBCPP_USING_IF_EXISTS;
0482 using ::remainder _LIBCPP_USING_IF_EXISTS;
0483 using ::remainderf _LIBCPP_USING_IF_EXISTS;
0484 using ::remquo _LIBCPP_USING_IF_EXISTS;
0485 using ::remquof _LIBCPP_USING_IF_EXISTS;
0486 using ::rint _LIBCPP_USING_IF_EXISTS;
0487 using ::rintf _LIBCPP_USING_IF_EXISTS;
0488 using ::round _LIBCPP_USING_IF_EXISTS;
0489 using ::roundf _LIBCPP_USING_IF_EXISTS;
0490 using ::scalbln _LIBCPP_USING_IF_EXISTS;
0491 using ::scalblnf _LIBCPP_USING_IF_EXISTS;
0492 using ::scalbn _LIBCPP_USING_IF_EXISTS;
0493 using ::scalbnf _LIBCPP_USING_IF_EXISTS;
0494 using ::tgamma _LIBCPP_USING_IF_EXISTS;
0495 using ::tgammaf _LIBCPP_USING_IF_EXISTS;
0496 using ::trunc _LIBCPP_USING_IF_EXISTS;
0497 using ::truncf _LIBCPP_USING_IF_EXISTS;
0498
0499 using ::acosl _LIBCPP_USING_IF_EXISTS;
0500 using ::asinl _LIBCPP_USING_IF_EXISTS;
0501 using ::atanl _LIBCPP_USING_IF_EXISTS;
0502 using ::atan2l _LIBCPP_USING_IF_EXISTS;
0503 using ::ceill _LIBCPP_USING_IF_EXISTS;
0504 using ::cosl _LIBCPP_USING_IF_EXISTS;
0505 using ::coshl _LIBCPP_USING_IF_EXISTS;
0506 using ::expl _LIBCPP_USING_IF_EXISTS;
0507 using ::fabsl _LIBCPP_USING_IF_EXISTS;
0508 using ::floorl _LIBCPP_USING_IF_EXISTS;
0509 using ::fmodl _LIBCPP_USING_IF_EXISTS;
0510 using ::frexpl _LIBCPP_USING_IF_EXISTS;
0511 using ::ldexpl _LIBCPP_USING_IF_EXISTS;
0512 using ::logl _LIBCPP_USING_IF_EXISTS;
0513 using ::log10l _LIBCPP_USING_IF_EXISTS;
0514 using ::modfl _LIBCPP_USING_IF_EXISTS;
0515 using ::powl _LIBCPP_USING_IF_EXISTS;
0516 using ::sinl _LIBCPP_USING_IF_EXISTS;
0517 using ::sinhl _LIBCPP_USING_IF_EXISTS;
0518 using ::sqrtl _LIBCPP_USING_IF_EXISTS;
0519 using ::tanl _LIBCPP_USING_IF_EXISTS;
0520
0521 using ::tanhl _LIBCPP_USING_IF_EXISTS;
0522 using ::acoshl _LIBCPP_USING_IF_EXISTS;
0523 using ::asinhl _LIBCPP_USING_IF_EXISTS;
0524 using ::atanhl _LIBCPP_USING_IF_EXISTS;
0525 using ::cbrtl _LIBCPP_USING_IF_EXISTS;
0526
0527 using ::copysignl _LIBCPP_USING_IF_EXISTS;
0528
0529 using ::erfl _LIBCPP_USING_IF_EXISTS;
0530 using ::erfcl _LIBCPP_USING_IF_EXISTS;
0531 using ::exp2l _LIBCPP_USING_IF_EXISTS;
0532 using ::expm1l _LIBCPP_USING_IF_EXISTS;
0533 using ::fdiml _LIBCPP_USING_IF_EXISTS;
0534 using ::fmal _LIBCPP_USING_IF_EXISTS;
0535 using ::fmaxl _LIBCPP_USING_IF_EXISTS;
0536 using ::fminl _LIBCPP_USING_IF_EXISTS;
0537 using ::hypotl _LIBCPP_USING_IF_EXISTS;
0538 using ::ilogbl _LIBCPP_USING_IF_EXISTS;
0539 using ::lgammal _LIBCPP_USING_IF_EXISTS;
0540 using ::llrintl _LIBCPP_USING_IF_EXISTS;
0541 using ::llroundl _LIBCPP_USING_IF_EXISTS;
0542 using ::log1pl _LIBCPP_USING_IF_EXISTS;
0543 using ::log2l _LIBCPP_USING_IF_EXISTS;
0544 using ::logbl _LIBCPP_USING_IF_EXISTS;
0545 using ::lrintl _LIBCPP_USING_IF_EXISTS;
0546 using ::lroundl _LIBCPP_USING_IF_EXISTS;
0547 using ::nanl _LIBCPP_USING_IF_EXISTS;
0548 using ::nearbyintl _LIBCPP_USING_IF_EXISTS;
0549 using ::nextafterl _LIBCPP_USING_IF_EXISTS;
0550 using ::nexttowardl _LIBCPP_USING_IF_EXISTS;
0551 using ::remainderl _LIBCPP_USING_IF_EXISTS;
0552 using ::remquol _LIBCPP_USING_IF_EXISTS;
0553 using ::rintl _LIBCPP_USING_IF_EXISTS;
0554 using ::roundl _LIBCPP_USING_IF_EXISTS;
0555 using ::scalblnl _LIBCPP_USING_IF_EXISTS;
0556 using ::scalbnl _LIBCPP_USING_IF_EXISTS;
0557 using ::tgammal _LIBCPP_USING_IF_EXISTS;
0558 using ::truncl _LIBCPP_USING_IF_EXISTS;
0559
0560 template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
0561 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT {
0562 # if __has_builtin(__builtin_isinf)
0563 return __builtin_isinf(__lcpp_x);
0564 # else
0565 return isinf(__lcpp_x);
0566 # endif
0567 }
0568
0569 template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
0570 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT {
0571 return std::isinf(__lcpp_x);
0572 }
0573
0574 # if _LIBCPP_STD_VER >= 20
0575 template <typename _Fp>
0576 _LIBCPP_HIDE_FROM_ABI constexpr _Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept {
0577 if ((__a <= 0 && __b >= 0) || (__a >= 0 && __b <= 0))
0578 return __t * __b + (1 - __t) * __a;
0579
0580 if (__t == 1)
0581 return __b;
0582 const _Fp __x = __a + __t * (__b - __a);
0583 if ((__t > 1) == (__b > __a))
0584 return __b < __x ? __x : __b;
0585 else
0586 return __x < __b ? __x : __b;
0587 }
0588
0589 _LIBCPP_HIDE_FROM_ABI inline constexpr float lerp(float __a, float __b, float __t) _NOEXCEPT {
0590 return __lerp(__a, __b, __t);
0591 }
0592
0593 _LIBCPP_HIDE_FROM_ABI inline constexpr double lerp(double __a, double __b, double __t) _NOEXCEPT {
0594 return __lerp(__a, __b, __t);
0595 }
0596
0597 _LIBCPP_HIDE_FROM_ABI inline constexpr long double lerp(long double __a, long double __b, long double __t) _NOEXCEPT {
0598 return __lerp(__a, __b, __t);
0599 }
0600
0601 template <class _A1, class _A2, class _A3>
0602 inline _LIBCPP_HIDE_FROM_ABI constexpr
0603 typename enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value && is_arithmetic<_A3>::value,
0604 __promote<_A1, _A2, _A3> >::type
0605 lerp(_A1 __a, _A2 __b, _A3 __t) noexcept {
0606 typedef typename __promote<_A1, _A2, _A3>::type __result_type;
0607 static_assert(!(
0608 _IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value && _IsSame<_A3, __result_type>::value));
0609 return std::__lerp((__result_type)__a, (__result_type)__b, (__result_type)__t);
0610 }
0611 # endif // _LIBCPP_STD_VER >= 20
0612
0613 _LIBCPP_END_NAMESPACE_STD
0614
0615 _LIBCPP_POP_MACROS
0616
0617 # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0618 # include <type_traits>
0619 # endif
0620 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0621
0622 #endif // _LIBCPP_CMATH