From Jason Turner

[cmath.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjqzk8o5n/{from.md → to.md} +172 -315
tmp/tmpjqzk8o5n/{from.md → to.md} RENAMED
@@ -25,552 +25,409 @@ namespace std {
25
  #define MATH_ERREXCEPT see below
26
 
27
  #define math_errhandling see below
28
 
29
  namespace std {
30
- float acos(float x); // see [library.c]
31
- double acos(double x);
32
- long double acos(long double x); // see [library.c]
33
  float acosf(float x);
34
  long double acosl(long double x);
35
 
36
- float asin(float x); // see [library.c]
37
- double asin(double x);
38
- long double asin(long double x); // see [library.c]
39
  float asinf(float x);
40
  long double asinl(long double x);
41
 
42
- float atan(float x); // see [library.c]
43
- double atan(double x);
44
- long double atan(long double x); // see [library.c]
45
  float atanf(float x);
46
  long double atanl(long double x);
47
 
48
- float atan2(float y, float x); // see [library.c]
49
- double atan2(double y, double x);
50
- long double atan2(long double y, long double x); // see [library.c]
51
  float atan2f(float y, float x);
52
  long double atan2l(long double y, long double x);
53
 
54
- float cos(float x); // see [library.c]
55
- double cos(double x);
56
- long double cos(long double x); // see [library.c]
57
  float cosf(float x);
58
  long double cosl(long double x);
59
 
60
- float sin(float x); // see [library.c]
61
- double sin(double x);
62
- long double sin(long double x); // see [library.c]
63
  float sinf(float x);
64
  long double sinl(long double x);
65
 
66
- float tan(float x); // see [library.c]
67
- double tan(double x);
68
- long double tan(long double x); // see [library.c]
69
  float tanf(float x);
70
  long double tanl(long double x);
71
 
72
- float acosh(float x); // see [library.c]
73
- double acosh(double x);
74
- long double acosh(long double x); // see [library.c]
75
  float acoshf(float x);
76
  long double acoshl(long double x);
77
 
78
- float asinh(float x); // see [library.c]
79
- double asinh(double x);
80
- long double asinh(long double x); // see [library.c]
81
  float asinhf(float x);
82
  long double asinhl(long double x);
83
 
84
- float atanh(float x); // see [library.c]
85
- double atanh(double x);
86
- long double atanh(long double x); // see [library.c]
87
  float atanhf(float x);
88
  long double atanhl(long double x);
89
 
90
- float cosh(float x); // see [library.c]
91
- double cosh(double x);
92
- long double cosh(long double x); // see [library.c]
93
  float coshf(float x);
94
  long double coshl(long double x);
95
 
96
- float sinh(float x); // see [library.c]
97
- double sinh(double x);
98
- long double sinh(long double x); // see [library.c]
99
  float sinhf(float x);
100
  long double sinhl(long double x);
101
 
102
- float tanh(float x); // see [library.c]
103
- double tanh(double x);
104
- long double tanh(long double x); // see [library.c]
105
  float tanhf(float x);
106
  long double tanhl(long double x);
107
 
108
- float exp(float x); // see [library.c]
109
- double exp(double x);
110
- long double exp(long double x); // see [library.c]
111
  float expf(float x);
112
  long double expl(long double x);
113
 
114
- float exp2(float x); // see [library.c]
115
- double exp2(double x);
116
- long double exp2(long double x); // see [library.c]
117
  float exp2f(float x);
118
  long double exp2l(long double x);
119
 
120
- float expm1(float x); // see [library.c]
121
- double expm1(double x);
122
- long double expm1(long double x); // see [library.c]
123
  float expm1f(float x);
124
  long double expm1l(long double x);
125
 
126
- float frexp(float value, int* exp); // see [library.c]
127
- double frexp(double value, int* exp);
128
- long double frexp(long double value, int* exp); // see [library.c]
129
- float frexpf(float value, int* exp);
130
- long double frexpl(long double value, int* exp);
131
 
132
- int ilogb(float x); // see [library.c]
133
- int ilogb(double x);
134
- int ilogb(long double x); // see [library.c]
135
- int ilogbf(float x);
136
- int ilogbl(long double x);
137
 
138
- float ldexp(float x, int exp); // see [library.c]
139
- double ldexp(double x, int exp);
140
- long double ldexp(long double x, int exp); // see [library.c]
141
- float ldexpf(float x, int exp);
142
- long double ldexpl(long double x, int exp);
143
 
144
- float log(float x); // see [library.c]
145
- double log(double x);
146
- long double log(long double x); // see [library.c]
147
  float logf(float x);
148
  long double logl(long double x);
149
 
150
- float log10(float x); // see [library.c]
151
- double log10(double x);
152
- long double log10(long double x); // see [library.c]
153
  float log10f(float x);
154
  long double log10l(long double x);
155
 
156
- float log1p(float x); // see [library.c]
157
- double log1p(double x);
158
- long double log1p(long double x); // see [library.c]
159
  float log1pf(float x);
160
  long double log1pl(long double x);
161
 
162
- float log2(float x); // see [library.c]
163
- double log2(double x);
164
- long double log2(long double x); // see [library.c]
165
  float log2f(float x);
166
  long double log2l(long double x);
167
 
168
- float logb(float x); // see [library.c]
169
- double logb(double x);
170
- long double logb(long double x); // see [library.c]
171
- float logbf(float x);
172
- long double logbl(long double x);
173
 
174
- float modf(float value, float* iptr); // see [library.c]
175
- double modf(double value, double* iptr);
176
- long double modf(long double value, long double* iptr); // see [library.c]
177
- float modff(float value, float* iptr);
178
- long double modfl(long double value, long double* iptr);
179
 
180
- float scalbn(float x, int n); // see [library.c]
181
- double scalbn(double x, int n);
182
- long double scalbn(long double x, int n); // see [library.c]
183
- float scalbnf(float x, int n);
184
- long double scalbnl(long double x, int n);
185
 
186
- float scalbln(float x, long int n); // see [library.c]
187
- double scalbln(double x, long int n);
188
- long double scalbln(long double x, long int n); // see [library.c]
189
- float scalblnf(float x, long int n);
190
- long double scalblnl(long double x, long int n);
191
 
192
- float cbrt(float x); // see [library.c]
193
- double cbrt(double x);
194
- long double cbrt(long double x); // see [library.c]
195
  float cbrtf(float x);
196
  long double cbrtl(long double x);
197
 
198
  // [c.math.abs], absolute values
199
- int abs(int j);
200
- long int abs(long int j);
201
- long long int abs(long long int j);
202
- float abs(float j);
203
- double abs(double j);
204
- long double abs(long double j);
205
 
206
- float fabs(float x); // see [library.c]
207
- double fabs(double x);
208
- long double fabs(long double x); // see [library.c]
209
- float fabsf(float x);
210
- long double fabsl(long double x);
211
 
212
- float hypot(float x, float y); // see [library.c]
213
- double hypot(double x, double y);
214
- long double hypot(long double x, long double y); // see [library.c]
215
  float hypotf(float x, float y);
216
  long double hypotl(long double x, long double y);
217
 
218
  // [c.math.hypot3], three-dimensional hypotenuse
219
- float hypot(float x, float y, float z);
220
- double hypot(double x, double y, double z);
221
- long double hypot(long double x, long double y, long double z);
222
 
223
- float pow(float x, float y); // see [library.c]
224
- double pow(double x, double y);
225
- long double pow(long double x, long double y); // see [library.c]
226
  float powf(float x, float y);
227
  long double powl(long double x, long double y);
228
 
229
- float sqrt(float x); // see [library.c]
230
- double sqrt(double x);
231
- long double sqrt(long double x); // see [library.c]
232
  float sqrtf(float x);
233
  long double sqrtl(long double x);
234
 
235
- float erf(float x); // see [library.c]
236
- double erf(double x);
237
- long double erf(long double x); // see [library.c]
238
  float erff(float x);
239
  long double erfl(long double x);
240
 
241
- float erfc(float x); // see [library.c]
242
- double erfc(double x);
243
- long double erfc(long double x); // see [library.c]
244
  float erfcf(float x);
245
  long double erfcl(long double x);
246
 
247
- float lgamma(float x); // see [library.c]
248
- double lgamma(double x);
249
- long double lgamma(long double x); // see [library.c]
250
  float lgammaf(float x);
251
  long double lgammal(long double x);
252
 
253
- float tgamma(float x); // see [library.c]
254
- double tgamma(double x);
255
- long double tgamma(long double x); // see [library.c]
256
  float tgammaf(float x);
257
  long double tgammal(long double x);
258
 
259
- float ceil(float x); // see [library.c]
260
- double ceil(double x);
261
- long double ceil(long double x); // see [library.c]
262
- float ceilf(float x);
263
- long double ceill(long double x);
264
 
265
- float floor(float x); // see [library.c]
266
- double floor(double x);
267
- long double floor(long double x); // see [library.c]
268
- float floorf(float x);
269
- long double floorl(long double x);
270
 
271
- float nearbyint(float x); // see [library.c]
272
- double nearbyint(double x);
273
- long double nearbyint(long double x); // see [library.c]
274
  float nearbyintf(float x);
275
  long double nearbyintl(long double x);
276
 
277
- float rint(float x); // see [library.c]
278
- double rint(double x);
279
- long double rint(long double x); // see [library.c]
280
  float rintf(float x);
281
  long double rintl(long double x);
282
 
283
- long int lrint(float x); // see [library.c]
284
- long int lrint(double x);
285
- long int lrint(long double x); // see [library.c]
286
  long int lrintf(float x);
287
  long int lrintl(long double x);
288
 
289
- long long int llrint(float x); // see [library.c]
290
- long long int llrint(double x);
291
- long long int llrint(long double x); // see [library.c]
292
  long long int llrintf(float x);
293
  long long int llrintl(long double x);
294
 
295
- float round(float x); // see [library.c]
296
- double round(double x);
297
- long double round(long double x); // see [library.c]
298
- float roundf(float x);
299
- long double roundl(long double x);
300
 
301
- long int lround(float x); // see [library.c]
302
- long int lround(double x);
303
- long int lround(long double x); // see [library.c]
304
- long int lroundf(float x);
305
- long int lroundl(long double x);
306
 
307
- long long int llround(float x); // see [library.c]
308
- long long int llround(double x);
309
- long long int llround(long double x); // see [library.c]
310
- long long int llroundf(float x);
311
- long long int llroundl(long double x);
312
 
313
- float trunc(float x); // see [library.c]
314
- double trunc(double x);
315
- long double trunc(long double x); // see [library.c]
316
- float truncf(float x);
317
- long double truncl(long double x);
318
 
319
- float fmod(float x, float y); // see [library.c]
320
- double fmod(double x, double y);
321
- long double fmod(long double x, long double y); // see [library.c]
322
- float fmodf(float x, float y);
323
- long double fmodl(long double x, long double y);
324
 
325
- float remainder(float x, float y); // see [library.c]
326
- double remainder(double x, double y);
327
- long double remainder(long double x, long double y); // see [library.c]
328
- float remainderf(float x, float y);
329
- long double remainderl(long double x, long double y);
330
 
331
- float remquo(float x, float y, int* quo); // see [library.c]
332
- double remquo(double x, double y, int* quo);
333
- long double remquo(long double x, long double y, int* quo); // see [library.c]
334
- float remquof(float x, float y, int* quo);
335
- long double remquol(long double x, long double y, int* quo);
336
 
337
- float copysign(float x, float y); // see [library.c]
338
- double copysign(double x, double y);
339
- long double copysign(long double x, long double y); // see [library.c]
340
- float copysignf(float x, float y);
341
- long double copysignl(long double x, long double y);
342
 
343
  double nan(const char* tagp);
344
  float nanf(const char* tagp);
345
  long double nanl(const char* tagp);
346
 
347
- float nextafter(float x, float y); // see [library.c]
348
- double nextafter(double x, double y);
349
- long double nextafter(long double x, long double y); // see [library.c]
350
- float nextafterf(float x, float y);
351
- long double nextafterl(long double x, long double y);
352
 
353
- float nexttoward(float x, long double y); // see [library.c]
354
- double nexttoward(double x, long double y);
355
- long double nexttoward(long double x, long double y); // see [library.c]
356
- float nexttowardf(float x, long double y);
357
- long double nexttowardl(long double x, long double y);
358
 
359
- float fdim(float x, float y); // see [library.c]
360
- double fdim(double x, double y);
361
- long double fdim(long double x, long double y); // see [library.c]
362
- float fdimf(float x, float y);
363
- long double fdiml(long double x, long double y);
364
 
365
- float fmax(float x, float y); // see [library.c]
366
- double fmax(double x, double y);
367
- long double fmax(long double x, long double y); // see [library.c]
368
- float fmaxf(float x, float y);
369
- long double fmaxl(long double x, long double y);
370
 
371
- float fmin(float x, float y); // see [library.c]
372
- double fmin(double x, double y);
373
- long double fmin(long double x, long double y); // see [library.c]
374
- float fminf(float x, float y);
375
- long double fminl(long double x, long double y);
376
 
377
- float fma(float x, float y, float z); // see [library.c]
378
- double fma(double x, double y, double z);
379
- long double fma(long double x, long double y, long double z); // see [library.c]
380
- float fmaf(float x, float y, float z);
381
- long double fmal(long double x, long double y, long double z);
382
 
383
  // [c.math.lerp], linear interpolation
384
- constexpr float lerp(float a, float b, float t) noexcept;
385
- constexpr double lerp(double a, double b, double t) noexcept;
386
- constexpr long double lerp(long double a, long double b, long double t) noexcept;
387
 
388
  // [c.math.fpclass], classification / comparison functions
389
- int fpclassify(float x);
390
- int fpclassify(double x);
391
- int fpclassify(long double x);
392
-
393
- bool isfinite(float x);
394
- bool isfinite(double x);
395
- bool isfinite(long double x);
396
-
397
- bool isinf(float x);
398
- bool isinf(double x);
399
- bool isinf(long double x);
400
-
401
- bool isnan(float x);
402
- bool isnan(double x);
403
- bool isnan(long double x);
404
-
405
- bool isnormal(float x);
406
- bool isnormal(double x);
407
- bool isnormal(long double x);
408
-
409
- bool signbit(float x);
410
- bool signbit(double x);
411
- bool signbit(long double x);
412
-
413
- bool isgreater(float x, float y);
414
- bool isgreater(double x, double y);
415
- bool isgreater(long double x, long double y);
416
-
417
- bool isgreaterequal(float x, float y);
418
- bool isgreaterequal(double x, double y);
419
- bool isgreaterequal(long double x, long double y);
420
-
421
- bool isless(float x, float y);
422
- bool isless(double x, double y);
423
- bool isless(long double x, long double y);
424
-
425
- bool islessequal(float x, float y);
426
- bool islessequal(double x, double y);
427
- bool islessequal(long double x, long double y);
428
-
429
- bool islessgreater(float x, float y);
430
- bool islessgreater(double x, double y);
431
- bool islessgreater(long double x, long double y);
432
-
433
- bool isunordered(float x, float y);
434
- bool isunordered(double x, double y);
435
- bool isunordered(long double x, long double y);
436
 
437
  // [sf.cmath], mathematical special functions
438
 
439
  // [sf.cmath.assoc.laguerre], associated Laguerre polynomials
440
- double assoc_laguerre(unsigned n, unsigned m, double x);
441
  float assoc_laguerref(unsigned n, unsigned m, float x);
442
  long double assoc_laguerrel(unsigned n, unsigned m, long double x);
443
 
444
  // [sf.cmath.assoc.legendre], associated Legendre functions
445
- double assoc_legendre(unsigned l, unsigned m, double x);
446
  float assoc_legendref(unsigned l, unsigned m, float x);
447
  long double assoc_legendrel(unsigned l, unsigned m, long double x);
448
 
449
  // [sf.cmath.beta], beta function
450
- double beta(double x, double y);
451
  float betaf(float x, float y);
452
  long double betal(long double x, long double y);
453
 
454
  // [sf.cmath.comp.ellint.1], complete elliptic integral of the first kind
455
- double comp_ellint_1(double k);
456
  float comp_ellint_1f(float k);
457
  long double comp_ellint_1l(long double k);
458
 
459
  // [sf.cmath.comp.ellint.2], complete elliptic integral of the second kind
460
- double comp_ellint_2(double k);
461
  float comp_ellint_2f(float k);
462
  long double comp_ellint_2l(long double k);
463
 
464
  // [sf.cmath.comp.ellint.3], complete elliptic integral of the third kind
465
- double comp_ellint_3(double k, double nu);
466
  float comp_ellint_3f(float k, float nu);
467
  long double comp_ellint_3l(long double k, long double nu);
468
 
469
  // [sf.cmath.cyl.bessel.i], regular modified cylindrical Bessel functions
470
- double cyl_bessel_i(double nu, double x);
471
  float cyl_bessel_if(float nu, float x);
472
  long double cyl_bessel_il(long double nu, long double x);
473
 
474
  // [sf.cmath.cyl.bessel.j], cylindrical Bessel functions of the first kind
475
- double cyl_bessel_j(double nu, double x);
476
  float cyl_bessel_jf(float nu, float x);
477
  long double cyl_bessel_jl(long double nu, long double x);
478
 
479
  // [sf.cmath.cyl.bessel.k], irregular modified cylindrical Bessel functions
480
- double cyl_bessel_k(double nu, double x);
481
  float cyl_bessel_kf(float nu, float x);
482
  long double cyl_bessel_kl(long double nu, long double x);
483
 
484
- // [sf.cmath.cyl.neumann], cylindrical Neumann functions;
485
  // cylindrical Bessel functions of the second kind
486
- double cyl_neumann(double nu, double x);
487
  float cyl_neumannf(float nu, float x);
488
  long double cyl_neumannl(long double nu, long double x);
489
 
490
  // [sf.cmath.ellint.1], incomplete elliptic integral of the first kind
491
- double ellint_1(double k, double phi);
492
  float ellint_1f(float k, float phi);
493
  long double ellint_1l(long double k, long double phi);
494
 
495
  // [sf.cmath.ellint.2], incomplete elliptic integral of the second kind
496
- double ellint_2(double k, double phi);
497
  float ellint_2f(float k, float phi);
498
  long double ellint_2l(long double k, long double phi);
499
 
500
  // [sf.cmath.ellint.3], incomplete elliptic integral of the third kind
501
- double ellint_3(double k, double nu, double phi);
 
502
  float ellint_3f(float k, float nu, float phi);
503
  long double ellint_3l(long double k, long double nu, long double phi);
504
 
505
  // [sf.cmath.expint], exponential integral
506
- double expint(double x);
507
  float expintf(float x);
508
  long double expintl(long double x);
509
 
510
  // [sf.cmath.hermite], Hermite polynomials
511
- double hermite(unsigned n, double x);
512
  float hermitef(unsigned n, float x);
513
  long double hermitel(unsigned n, long double x);
514
 
515
  // [sf.cmath.laguerre], Laguerre polynomials
516
- double laguerre(unsigned n, double x);
517
  float laguerref(unsigned n, float x);
518
  long double laguerrel(unsigned n, long double x);
519
 
520
  // [sf.cmath.legendre], Legendre polynomials
521
- double legendre(unsigned l, double x);
522
  float legendref(unsigned l, float x);
523
  long double legendrel(unsigned l, long double x);
524
 
525
  // [sf.cmath.riemann.zeta], Riemann zeta function
526
- double riemann_zeta(double x);
527
  float riemann_zetaf(float x);
528
  long double riemann_zetal(long double x);
529
 
530
  // [sf.cmath.sph.bessel], spherical Bessel functions of the first kind
531
- double sph_bessel(unsigned n, double x);
532
  float sph_besself(unsigned n, float x);
533
  long double sph_bessell(unsigned n, long double x);
534
 
535
  // [sf.cmath.sph.legendre], spherical associated Legendre functions
536
- double sph_legendre(unsigned l, unsigned m, double theta);
537
  float sph_legendref(unsigned l, unsigned m, float theta);
538
  long double sph_legendrel(unsigned l, unsigned m, long double theta);
539
 
540
  // [sf.cmath.sph.neumann], spherical Neumann functions;
541
  // spherical Bessel functions of the second kind
542
- double sph_neumann(unsigned n, double x);
543
  float sph_neumannf(unsigned n, float x);
544
  long double sph_neumannl(unsigned n, long double x);
545
  }
546
  ```
547
 
548
  The contents and meaning of the header `<cmath>` are the same as the C
549
  standard library header `<math.h>`, with the addition of a
550
- three-dimensional hypotenuse function ([[c.math.hypot3]]) and the
551
- mathematical special functions described in [[sf.cmath]].
 
552
 
553
  [*Note 1*: Several functions have additional overloads in this
554
  document, but they have the same behavior as in the C standard library
555
  [[library.c]]. — *end note*]
556
 
557
- For each set of overloaded functions within `<cmath>`, with the
558
- exception of `abs`, there shall be additional overloads sufficient to
559
- ensure:
 
 
560
 
561
- - If any argument of arithmetic type corresponding to a `double`
562
- parameter has type `long double`, then all arguments of arithmetic
563
- type [[basic.fundamental]] corresponding to `double` parameters are
564
- effectively cast to `long double`.
565
- - Otherwise, if any argument of arithmetic type corresponding to a
566
- `double` parameter has type `double` or an integer type, then all
567
- arguments of arithmetic type corresponding to `double` parameters are
568
- effectively cast to `double`.
569
- - \[*Note 2*: Otherwise, all arguments of arithmetic type corresponding
570
- to `double` parameters have type `float`. *end note*]
 
 
571
 
572
- [*Note 3*: `abs` is exempted from these rules in order to stay
573
- compatible with C. *end note*]
 
574
 
575
- ISO C 7.12
576
 
 
25
  #define MATH_ERREXCEPT see below
26
 
27
  #define math_errhandling see below
28
 
29
  namespace std {
30
+ floating-point-type acos(floating-point-type x);
 
 
31
  float acosf(float x);
32
  long double acosl(long double x);
33
 
34
+ floating-point-type asin(floating-point-type x);
 
 
35
  float asinf(float x);
36
  long double asinl(long double x);
37
 
38
+ floating-point-type atan(floating-point-type x);
 
 
39
  float atanf(float x);
40
  long double atanl(long double x);
41
 
42
+ floating-point-type atan2(floating-point-type y, floating-point-type x);
 
 
43
  float atan2f(float y, float x);
44
  long double atan2l(long double y, long double x);
45
 
46
+ floating-point-type cos(floating-point-type x);
 
 
47
  float cosf(float x);
48
  long double cosl(long double x);
49
 
50
+ floating-point-type sin(floating-point-type x);
 
 
51
  float sinf(float x);
52
  long double sinl(long double x);
53
 
54
+ floating-point-type tan(floating-point-type x);
 
 
55
  float tanf(float x);
56
  long double tanl(long double x);
57
 
58
+ floating-point-type acosh(floating-point-type x);
 
 
59
  float acoshf(float x);
60
  long double acoshl(long double x);
61
 
62
+ floating-point-type asinh(floating-point-type x);
 
 
63
  float asinhf(float x);
64
  long double asinhl(long double x);
65
 
66
+ floating-point-type atanh(floating-point-type x);
 
 
67
  float atanhf(float x);
68
  long double atanhl(long double x);
69
 
70
+ floating-point-type cosh(floating-point-type x);
 
 
71
  float coshf(float x);
72
  long double coshl(long double x);
73
 
74
+ floating-point-type sinh(floating-point-type x);
 
 
75
  float sinhf(float x);
76
  long double sinhl(long double x);
77
 
78
+ floating-point-type tanh(floating-point-type x);
 
 
79
  float tanhf(float x);
80
  long double tanhl(long double x);
81
 
82
+ floating-point-type exp(floating-point-type x);
 
 
83
  float expf(float x);
84
  long double expl(long double x);
85
 
86
+ floating-point-type exp2(floating-point-type x);
 
 
87
  float exp2f(float x);
88
  long double exp2l(long double x);
89
 
90
+ floating-point-type expm1(floating-point-type x);
 
 
91
  float expm1f(float x);
92
  long double expm1l(long double x);
93
 
94
+ constexpr floating-point-type frexp(floating-point-type value, int* exp);
95
+ constexpr float frexpf(float value, int* exp);
96
+ constexpr long double frexpl(long double value, int* exp);
 
 
97
 
98
+ constexpr int ilogb(floating-point-type x);
99
+ constexpr int ilogbf(float x);
100
+ constexpr int ilogbl(long double x);
 
 
101
 
102
+ constexpr floating-point-type ldexp(floating-point-type x, int exp);
103
+ constexpr float ldexpf(float x, int exp);
104
+ constexpr long double ldexpl(long double x, int exp);
 
 
105
 
106
+ floating-point-type log(floating-point-type x);
 
 
107
  float logf(float x);
108
  long double logl(long double x);
109
 
110
+ floating-point-type log10(floating-point-type x);
 
 
111
  float log10f(float x);
112
  long double log10l(long double x);
113
 
114
+ floating-point-type log1p(floating-point-type x);
 
 
115
  float log1pf(float x);
116
  long double log1pl(long double x);
117
 
118
+ floating-point-type log2(floating-point-type x);
 
 
119
  float log2f(float x);
120
  long double log2l(long double x);
121
 
122
+ constexpr floating-point-type logb(floating-point-type x);
123
+ constexpr float logbf(float x);
124
+ constexpr long double logbl(long double x);
 
 
125
 
126
+ constexpr floating-point-type modf(floating-point-type value, floating-point-type* iptr);
127
+ constexpr float modff(float value, float* iptr);
128
+ constexpr long double modfl(long double value, long double* iptr);
 
 
129
 
130
+ constexpr floating-point-type scalbn(floating-point-type x, int n);
131
+ constexpr float scalbnf(float x, int n);
132
+ constexpr long double scalbnl(long double x, int n);
 
 
133
 
134
+ constexpr floating-point-type scalbln(floating-point-type x, long int n);
135
+ constexpr float scalblnf(float x, long int n);
136
+ constexpr long double scalblnl(long double x, long int n);
 
 
137
 
138
+ floating-point-type cbrt(floating-point-type x);
 
 
139
  float cbrtf(float x);
140
  long double cbrtl(long double x);
141
 
142
  // [c.math.abs], absolute values
143
+ constexpr int abs(int j);
144
+ constexpr long int abs(long int j);
145
+ constexpr long long int abs(long long int j);
146
+ constexpr floating-point-type abs(floating-point-type j);
 
 
147
 
148
+ constexpr floating-point-type fabs(floating-point-type x);
149
+ constexpr float fabsf(float x);
150
+ constexpr long double fabsl(long double x);
 
 
151
 
152
+ floating-point-type hypot(floating-point-type x, floating-point-type y);
 
 
153
  float hypotf(float x, float y);
154
  long double hypotl(long double x, long double y);
155
 
156
  // [c.math.hypot3], three-dimensional hypotenuse
157
+ floating-point-type hypot(floating-point-type x, floating-point-type y,
158
+ floating-point-type z);
 
159
 
160
+ floating-point-type pow(floating-point-type x, floating-point-type y);
 
 
161
  float powf(float x, float y);
162
  long double powl(long double x, long double y);
163
 
164
+ floating-point-type sqrt(floating-point-type x);
 
 
165
  float sqrtf(float x);
166
  long double sqrtl(long double x);
167
 
168
+ floating-point-type erf(floating-point-type x);
 
 
169
  float erff(float x);
170
  long double erfl(long double x);
171
 
172
+ floating-point-type erfc(floating-point-type x);
 
 
173
  float erfcf(float x);
174
  long double erfcl(long double x);
175
 
176
+ floating-point-type lgamma(floating-point-type x);
 
 
177
  float lgammaf(float x);
178
  long double lgammal(long double x);
179
 
180
+ floating-point-type tgamma(floating-point-type x);
 
 
181
  float tgammaf(float x);
182
  long double tgammal(long double x);
183
 
184
+ constexpr floating-point-type ceil(floating-point-type x);
185
+ constexpr float ceilf(float x);
186
+ constexpr long double ceill(long double x);
 
 
187
 
188
+ constexpr floating-point-type floor(floating-point-type x);
189
+ constexpr float floorf(float x);
190
+ constexpr long double floorl(long double x);
 
 
191
 
192
+ floating-point-type nearbyint(floating-point-type x);
 
 
193
  float nearbyintf(float x);
194
  long double nearbyintl(long double x);
195
 
196
+ floating-point-type rint(floating-point-type x);
 
 
197
  float rintf(float x);
198
  long double rintl(long double x);
199
 
200
+ long int lrint(floating-point-type x);
 
 
201
  long int lrintf(float x);
202
  long int lrintl(long double x);
203
 
204
+ long long int llrint(floating-point-type x);
 
 
205
  long long int llrintf(float x);
206
  long long int llrintl(long double x);
207
 
208
+ constexpr floating-point-type round(floating-point-type x);
209
+ constexpr float roundf(float x);
210
+ constexpr long double roundl(long double x);
 
 
211
 
212
+ constexpr long int lround(floating-point-type x);
213
+ constexpr long int lroundf(float x);
214
+ constexpr long int lroundl(long double x);
 
 
215
 
216
+ constexpr long long int llround(floating-point-type x);
217
+ constexpr long long int llroundf(float x);
218
+ constexpr long long int llroundl(long double x);
 
 
219
 
220
+ constexpr floating-point-type trunc(floating-point-type x);
221
+ constexpr float truncf(float x);
222
+ constexpr long double truncl(long double x);
 
 
223
 
224
+ constexpr floating-point-type fmod(floating-point-type x, floating-point-type y);
225
+ constexpr float fmodf(float x, float y);
226
+ constexpr long double fmodl(long double x, long double y);
 
 
227
 
228
+ constexpr floating-point-type remainder(floating-point-type x, floating-point-type y);
229
+ constexpr float remainderf(float x, float y);
230
+ constexpr long double remainderl(long double x, long double y);
 
 
231
 
232
+ constexpr floating-point-type remquo(floating-point-type x, floating-point-type y, int* quo);
233
+ constexpr float remquof(float x, float y, int* quo);
234
+ constexpr long double remquol(long double x, long double y, int* quo);
 
 
235
 
236
+ constexpr floating-point-type copysign(floating-point-type x, floating-point-type y);
237
+ constexpr float copysignf(float x, float y);
238
+ constexpr long double copysignl(long double x, long double y);
 
 
239
 
240
  double nan(const char* tagp);
241
  float nanf(const char* tagp);
242
  long double nanl(const char* tagp);
243
 
244
+ constexpr floating-point-type nextafter(floating-point-type x, floating-point-type y);
245
+ constexpr float nextafterf(float x, float y);
246
+ constexpr long double nextafterl(long double x, long double y);
 
 
247
 
248
+ constexpr floating-point-type nexttoward(floating-point-type x, long double y);
249
+ constexpr float nexttowardf(float x, long double y);
250
+ constexpr long double nexttowardl(long double x, long double y);
 
 
251
 
252
+ constexpr floating-point-type fdim(floating-point-type x, floating-point-type y);
253
+ constexpr float fdimf(float x, float y);
254
+ constexpr long double fdiml(long double x, long double y);
 
 
255
 
256
+ constexpr floating-point-type fmax(floating-point-type x, floating-point-type y);
257
+ constexpr float fmaxf(float x, float y);
258
+ constexpr long double fmaxl(long double x, long double y);
 
 
259
 
260
+ constexpr floating-point-type fmin(floating-point-type x, floating-point-type y);
261
+ constexpr float fminf(float x, float y);
262
+ constexpr long double fminl(long double x, long double y);
 
 
263
 
264
+ constexpr floating-point-type fma(floating-point-type x, floating-point-type y,
265
+ floating-point-type z);
266
+ constexpr float fmaf(float x, float y, float z);
267
+ constexpr long double fmal(long double x, long double y, long double z);
 
268
 
269
  // [c.math.lerp], linear interpolation
270
+ constexpr floating-point-type lerp(floating-point-type a, floating-point-type b,
271
+ floating-point-type t) noexcept;
 
272
 
273
  // [c.math.fpclass], classification / comparison functions
274
+ constexpr int fpclassify(floating-point-type x);
275
+ constexpr bool isfinite(floating-point-type x);
276
+ constexpr bool isinf(floating-point-type x);
277
+ constexpr bool isnan(floating-point-type x);
278
+ constexpr bool isnormal(floating-point-type x);
279
+ constexpr bool signbit(floating-point-type x);
280
+ constexpr bool isgreater(floating-point-type x, floating-point-type y);
281
+ constexpr bool isgreaterequal(floating-point-type x, floating-point-type y);
282
+ constexpr bool isless(floating-point-type x, floating-point-type y);
283
+ constexpr bool islessequal(floating-point-type x, floating-point-type y);
284
+ constexpr bool islessgreater(floating-point-type x, floating-point-type y);
285
+ constexpr bool isunordered(floating-point-type x, floating-point-type y);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
 
287
  // [sf.cmath], mathematical special functions
288
 
289
  // [sf.cmath.assoc.laguerre], associated Laguerre polynomials
290
+ floating-point-type assoc_laguerre(unsigned n, unsigned m, floating-point-type x);
291
  float assoc_laguerref(unsigned n, unsigned m, float x);
292
  long double assoc_laguerrel(unsigned n, unsigned m, long double x);
293
 
294
  // [sf.cmath.assoc.legendre], associated Legendre functions
295
+ floating-point-type assoc_legendre(unsigned l, unsigned m, floating-point-type x);
296
  float assoc_legendref(unsigned l, unsigned m, float x);
297
  long double assoc_legendrel(unsigned l, unsigned m, long double x);
298
 
299
  // [sf.cmath.beta], beta function
300
+ floating-point-type beta(floating-point-type x, floating-point-type y);
301
  float betaf(float x, float y);
302
  long double betal(long double x, long double y);
303
 
304
  // [sf.cmath.comp.ellint.1], complete elliptic integral of the first kind
305
+ floating-point-type comp_ellint_1(floating-point-type k);
306
  float comp_ellint_1f(float k);
307
  long double comp_ellint_1l(long double k);
308
 
309
  // [sf.cmath.comp.ellint.2], complete elliptic integral of the second kind
310
+ floating-point-type comp_ellint_2(floating-point-type k);
311
  float comp_ellint_2f(float k);
312
  long double comp_ellint_2l(long double k);
313
 
314
  // [sf.cmath.comp.ellint.3], complete elliptic integral of the third kind
315
+ floating-point-type comp_ellint_3(floating-point-type k, floating-point-type nu);
316
  float comp_ellint_3f(float k, float nu);
317
  long double comp_ellint_3l(long double k, long double nu);
318
 
319
  // [sf.cmath.cyl.bessel.i], regular modified cylindrical Bessel functions
320
+ floating-point-type cyl_bessel_i(floating-point-type nu, floating-point-type x);
321
  float cyl_bessel_if(float nu, float x);
322
  long double cyl_bessel_il(long double nu, long double x);
323
 
324
  // [sf.cmath.cyl.bessel.j], cylindrical Bessel functions of the first kind
325
+ floating-point-type cyl_bessel_j(floating-point-type nu, floating-point-type x);
326
  float cyl_bessel_jf(float nu, float x);
327
  long double cyl_bessel_jl(long double nu, long double x);
328
 
329
  // [sf.cmath.cyl.bessel.k], irregular modified cylindrical Bessel functions
330
+ floating-point-type cyl_bessel_k(floating-point-type nu, floating-point-type x);
331
  float cyl_bessel_kf(float nu, float x);
332
  long double cyl_bessel_kl(long double nu, long double x);
333
 
334
+ // [sf.cmath.cyl.neumann], cylindrical Neumann functions
335
  // cylindrical Bessel functions of the second kind
336
+ floating-point-type cyl_neumann(floating-point-type nu, floating-point-type x);
337
  float cyl_neumannf(float nu, float x);
338
  long double cyl_neumannl(long double nu, long double x);
339
 
340
  // [sf.cmath.ellint.1], incomplete elliptic integral of the first kind
341
+ floating-point-type ellint_1(floating-point-type k, floating-point-type phi);
342
  float ellint_1f(float k, float phi);
343
  long double ellint_1l(long double k, long double phi);
344
 
345
  // [sf.cmath.ellint.2], incomplete elliptic integral of the second kind
346
+ floating-point-type ellint_2(floating-point-type k, floating-point-type phi);
347
  float ellint_2f(float k, float phi);
348
  long double ellint_2l(long double k, long double phi);
349
 
350
  // [sf.cmath.ellint.3], incomplete elliptic integral of the third kind
351
+ floating-point-type ellint_3(floating-point-type k, floating-point-type nu,
352
+ floating-point-type phi);
353
  float ellint_3f(float k, float nu, float phi);
354
  long double ellint_3l(long double k, long double nu, long double phi);
355
 
356
  // [sf.cmath.expint], exponential integral
357
+ floating-point-type expint(floating-point-type x);
358
  float expintf(float x);
359
  long double expintl(long double x);
360
 
361
  // [sf.cmath.hermite], Hermite polynomials
362
+ floating-point-type hermite(unsigned n, floating-point-type x);
363
  float hermitef(unsigned n, float x);
364
  long double hermitel(unsigned n, long double x);
365
 
366
  // [sf.cmath.laguerre], Laguerre polynomials
367
+ floating-point-type laguerre(unsigned n, floating-point-type x);
368
  float laguerref(unsigned n, float x);
369
  long double laguerrel(unsigned n, long double x);
370
 
371
  // [sf.cmath.legendre], Legendre polynomials
372
+ floating-point-type legendre(unsigned l, floating-point-type x);
373
  float legendref(unsigned l, float x);
374
  long double legendrel(unsigned l, long double x);
375
 
376
  // [sf.cmath.riemann.zeta], Riemann zeta function
377
+ floating-point-type riemann_zeta(floating-point-type x);
378
  float riemann_zetaf(float x);
379
  long double riemann_zetal(long double x);
380
 
381
  // [sf.cmath.sph.bessel], spherical Bessel functions of the first kind
382
+ floating-point-type sph_bessel(unsigned n, floating-point-type x);
383
  float sph_besself(unsigned n, float x);
384
  long double sph_bessell(unsigned n, long double x);
385
 
386
  // [sf.cmath.sph.legendre], spherical associated Legendre functions
387
+ floating-point-type sph_legendre(unsigned l, unsigned m, floating-point-type theta);
388
  float sph_legendref(unsigned l, unsigned m, float theta);
389
  long double sph_legendrel(unsigned l, unsigned m, long double theta);
390
 
391
  // [sf.cmath.sph.neumann], spherical Neumann functions;
392
  // spherical Bessel functions of the second kind
393
+ floating-point-type sph_neumann(unsigned n, floating-point-type x);
394
  float sph_neumannf(unsigned n, float x);
395
  long double sph_neumannl(unsigned n, long double x);
396
  }
397
  ```
398
 
399
  The contents and meaning of the header `<cmath>` are the same as the C
400
  standard library header `<math.h>`, with the addition of a
401
+ three-dimensional hypotenuse function [[c.math.hypot3]], a linear
402
+ interpolation function [[c.math.lerp]], and the mathematical special
403
+ functions described in [[sf.cmath]].
404
 
405
  [*Note 1*: Several functions have additional overloads in this
406
  document, but they have the same behavior as in the C standard library
407
  [[library.c]]. — *end note*]
408
 
409
+ For each function with at least one parameter of type
410
+ *floating-point-type*, the implementation provides an overload for each
411
+ cv-unqualified floating-point type [[basic.fundamental]] where all uses
412
+ of *floating-point-type* in the function signature are replaced with
413
+ that floating-point type.
414
 
415
+ For each function with at least one parameter of type
416
+ *floating-point-type* other than `abs`, the implementation also provides
417
+ additional overloads sufficient to ensure that, if every argument
418
+ corresponding to a *floating-point-type* parameter has arithmetic type,
419
+ then every such argument is effectively cast to the floating-point type
420
+ with the greatest floating-point conversion rank and greatest
421
+ floating-point conversion subrank among the types of all such arguments,
422
+ where arguments of integer type are considered to have the same
423
+ floating-point conversion rank as `double`. If no such floating-point
424
+ type with the greatest rank and subrank exists, then overload resolution
425
+ does not result in a usable candidate [[over.match.general]] from the
426
+ overloads provided by the implementation.
427
 
428
+ An invocation of `nexttoward` is ill-formed if the argument
429
+ corresponding to the *floating-point-type* parameter has extended
430
+ floating-point type.
431
 
432
+ See also: ISO C 7.12
433