From Jason Turner

[cmath.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpqdf0_ovk/{from.md → to.md} +67 -62
tmp/tmpqdf0_ovk/{from.md → to.md} RENAMED
@@ -209,11 +209,11 @@ namespace std {
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(double x, 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);
@@ -378,123 +378,128 @@ namespace std {
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.fpclass], classification / comparison functions
384
  int fpclassify(float x);
385
  int fpclassify(double x);
386
  int fpclassify(long double x);
387
 
388
- int isfinite(float x);
389
- int isfinite(double x);
390
- int isfinite(long double x);
391
 
392
- int isinf(float x);
393
- int isinf(double x);
394
- int isinf(long double x);
395
 
396
- int isnan(float x);
397
- int isnan(double x);
398
- int isnan(long double x);
399
 
400
- int isnormal(float x);
401
- int isnormal(double x);
402
- int isnormal(long double x);
403
 
404
- int signbit(float x);
405
- int signbit(double x);
406
- int signbit(long double x);
407
 
408
- int isgreater(float x, float y);
409
- int isgreater(double x, double y);
410
- int isgreater(long double x, long double y);
411
 
412
- int isgreaterequal(float x, float y);
413
- int isgreaterequal(double x, double y);
414
- int isgreaterequal(long double x, long double y);
415
 
416
- int isless(float x, float y);
417
- int isless(double x, double y);
418
- int isless(long double x, long double y);
419
 
420
- int islessequal(float x, float y);
421
- int islessequal(double x, double y);
422
- int islessequal(long double x, long double y);
423
 
424
- int islessgreater(float x, float y);
425
- int islessgreater(double x, double y);
426
- int islessgreater(long double x, long double y);
427
 
428
- int isunordered(float x, float y);
429
- int isunordered(double x, double y);
430
- int isunordered(long double x, long double y);
431
 
432
  // [sf.cmath], mathematical special functions
433
 
434
- // [sf.cmath.assoc_laguerre], associated Laguerre polynomials
435
  double assoc_laguerre(unsigned n, unsigned m, double x);
436
  float assoc_laguerref(unsigned n, unsigned m, float x);
437
  long double assoc_laguerrel(unsigned n, unsigned m, long double x);
438
 
439
- // [sf.cmath.assoc_legendre], associated Legendre functions
440
  double assoc_legendre(unsigned l, unsigned m, double x);
441
  float assoc_legendref(unsigned l, unsigned m, float x);
442
  long double assoc_legendrel(unsigned l, unsigned m, long double x);
443
 
444
  // [sf.cmath.beta], beta function
445
  double beta(double x, double y);
446
  float betaf(float x, float y);
447
  long double betal(long double x, long double y);
448
 
449
- // [sf.cmath.comp_ellint_1], complete elliptic integral of the first kind
450
  double comp_ellint_1(double k);
451
  float comp_ellint_1f(float k);
452
  long double comp_ellint_1l(long double k);
453
 
454
- // [sf.cmath.comp_ellint_2], complete elliptic integral of the second kind
455
  double comp_ellint_2(double k);
456
  float comp_ellint_2f(float k);
457
  long double comp_ellint_2l(long double k);
458
 
459
- // [sf.cmath.comp_ellint_3], complete elliptic integral of the third kind
460
  double comp_ellint_3(double k, double nu);
461
  float comp_ellint_3f(float k, float nu);
462
  long double comp_ellint_3l(long double k, long double nu);
463
 
464
- // [sf.cmath.cyl_bessel_i], regular modified cylindrical Bessel functions
465
  double cyl_bessel_i(double nu, double x);
466
  float cyl_bessel_if(float nu, float x);
467
  long double cyl_bessel_il(long double nu, long double x);
468
 
469
- // [sf.cmath.cyl_bessel_j], cylindrical Bessel functions of the first kind
470
  double cyl_bessel_j(double nu, double x);
471
  float cyl_bessel_jf(float nu, float x);
472
  long double cyl_bessel_jl(long double nu, long double x);
473
 
474
- // [sf.cmath.cyl_bessel_k], irregular modified cylindrical Bessel functions
475
  double cyl_bessel_k(double nu, double x);
476
  float cyl_bessel_kf(float nu, float x);
477
  long double cyl_bessel_kl(long double nu, long double x);
478
 
479
- // [sf.cmath.cyl_neumann], cylindrical Neumann functions;
480
  // cylindrical Bessel functions of the second kind
481
  double cyl_neumann(double nu, double x);
482
  float cyl_neumannf(float nu, float x);
483
  long double cyl_neumannl(long double nu, long double x);
484
 
485
- // [sf.cmath.ellint_1], incomplete elliptic integral of the first kind
486
  double ellint_1(double k, double phi);
487
  float ellint_1f(float k, float phi);
488
  long double ellint_1l(long double k, long double phi);
489
 
490
- // [sf.cmath.ellint_2], incomplete elliptic integral of the second kind
491
  double ellint_2(double k, double phi);
492
  float ellint_2f(float k, float phi);
493
  long double ellint_2l(long double k, long double phi);
494
 
495
- // [sf.cmath.ellint_3], incomplete elliptic integral of the third kind
496
  double ellint_3(double k, double nu, double phi);
497
  float ellint_3f(float k, float nu, float phi);
498
  long double ellint_3l(long double k, long double nu, long double phi);
499
 
500
  // [sf.cmath.expint], exponential integral
@@ -515,27 +520,27 @@ namespace std {
515
  // [sf.cmath.legendre], Legendre polynomials
516
  double legendre(unsigned l, double x);
517
  float legendref(unsigned l, float x);
518
  long double legendrel(unsigned l, long double x);
519
 
520
- // [sf.cmath.riemann_zeta], Riemann zeta function
521
  double riemann_zeta(double x);
522
  float riemann_zetaf(float x);
523
  long double riemann_zetal(long double x);
524
 
525
- // [sf.cmath.sph_bessel], spherical Bessel functions of the first kind
526
  double sph_bessel(unsigned n, double x);
527
  float sph_besself(unsigned n, float x);
528
  long double sph_bessell(unsigned n, long double x);
529
 
530
- // [sf.cmath.sph_legendre], spherical associated Legendre functions
531
  double sph_legendre(unsigned l, unsigned m, double theta);
532
  float sph_legendref(unsigned l, unsigned m, float theta);
533
  long double sph_legendrel(unsigned l, unsigned m, long double theta);
534
 
535
- // [sf.cmath.sph_neumann], spherical Neumann functions;
536
- // spherical Bessel functions of the second kind:
537
  double sph_neumann(unsigned n, double x);
538
  float sph_neumannf(unsigned n, float x);
539
  long double sph_neumannl(unsigned n, long double x);
540
  }
541
  ```
@@ -544,28 +549,28 @@ The contents and meaning of the header `<cmath>` are the same as the C
544
  standard library header `<math.h>`, with the addition of a
545
  three-dimensional hypotenuse function ([[c.math.hypot3]]) and the
546
  mathematical special functions described in [[sf.cmath]].
547
 
548
  [*Note 1*: Several functions have additional overloads in this
549
- International Standard, but they have the same behavior as in the C
550
- standard library ([[library.c]]). — *end note*]
551
 
552
  For each set of overloaded functions within `<cmath>`, with the
553
  exception of `abs`, there shall be additional overloads sufficient to
554
  ensure:
555
 
556
- 1. If any argument of arithmetic type corresponding to a `double`
557
  parameter has type `long double`, then all arguments of arithmetic
558
- type ([[basic.fundamental]]) corresponding to `double` parameters
559
- are effectively cast to `long double`.
560
- 2. Otherwise, if any argument of arithmetic type corresponding to a
561
  `double` parameter has type `double` or an integer type, then all
562
- arguments of arithmetic type corresponding to `double` parameters
563
- are effectively cast to `double`.
564
- 3. Otherwise, all arguments of arithmetic type corresponding to
565
- `double` parameters have type `float`.
566
 
567
- [*Note 2*: `abs` is exempted from these rules in order to stay
568
  compatible with C. — *end note*]
569
 
570
  ISO C 7.12
571
 
 
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);
 
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
 
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
  ```
 
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