From Jason Turner

[cmath.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpp0hnftie/{from.md → to.md} +116 -104
tmp/tmpp0hnftie/{from.md → to.md} RENAMED
@@ -1,13 +1,8 @@
1
  ### Header `<cmath>` synopsis <a id="cmath.syn">[[cmath.syn]]</a>
2
 
3
  ``` cpp
4
- namespace std {
5
- using float_t = see below;
6
- using double_t = see below;
7
- }
8
-
9
  #define HUGE_VAL see below
10
  #define HUGE_VALF see below
11
  #define HUGE_VALL see below
12
  #define INFINITY see below
13
  #define NAN see below
@@ -25,73 +20,76 @@ namespace std {
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
 
@@ -101,25 +99,25 @@ namespace std {
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
 
@@ -133,55 +131,55 @@ namespace std {
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
 
@@ -247,10 +245,18 @@ namespace std {
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);
@@ -259,10 +265,15 @@ namespace std {
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
 
@@ -394,40 +405,41 @@ namespace std {
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
 
 
1
  ### Header `<cmath>` synopsis <a id="cmath.syn">[[cmath.syn]]</a>
2
 
3
  ``` cpp
 
 
 
 
 
4
  #define HUGE_VAL see below
5
  #define HUGE_VALF see below
6
  #define HUGE_VALL see below
7
  #define INFINITY see below
8
  #define NAN see below
 
20
  #define MATH_ERREXCEPT see below
21
 
22
  #define math_errhandling see below
23
 
24
  namespace std {
25
+ using float_t = see below;
26
+ using double_t = see below;
 
27
 
28
+ constexpr floating-point-type acos(floating-point-type x);
29
+ constexpr float acosf(float x);
30
+ constexpr long double acosl(long double x);
31
 
32
+ constexpr floating-point-type asin(floating-point-type x);
33
+ constexpr float asinf(float x);
34
+ constexpr long double asinl(long double x);
35
 
36
+ constexpr floating-point-type atan(floating-point-type x);
37
+ constexpr float atanf(float x);
38
+ constexpr long double atanl(long double x);
39
 
40
+ constexpr floating-point-type atan2(floating-point-type y, floating-point-type x);
41
+ constexpr float atan2f(float y, float x);
42
+ constexpr long double atan2l(long double y, long double x);
43
 
44
+ constexpr floating-point-type cos(floating-point-type x);
45
+ constexpr float cosf(float x);
46
+ constexpr long double cosl(long double x);
47
 
48
+ constexpr floating-point-type sin(floating-point-type x);
49
+ constexpr float sinf(float x);
50
+ constexpr long double sinl(long double x);
51
 
52
+ constexpr floating-point-type tan(floating-point-type x);
53
+ constexpr float tanf(float x);
54
+ constexpr long double tanl(long double x);
55
 
56
+ constexpr floating-point-type acosh(floating-point-type x);
57
+ constexpr float acoshf(float x);
58
+ constexpr long double acoshl(long double x);
59
 
60
+ constexpr floating-point-type asinh(floating-point-type x);
61
+ constexpr float asinhf(float x);
62
+ constexpr long double asinhl(long double x);
63
 
64
+ constexpr floating-point-type atanh(floating-point-type x);
65
+ constexpr float atanhf(float x);
66
+ constexpr long double atanhl(long double x);
67
 
68
+ constexpr floating-point-type cosh(floating-point-type x);
69
+ constexpr float coshf(float x);
70
+ constexpr long double coshl(long double x);
71
 
72
+ constexpr floating-point-type sinh(floating-point-type x);
73
+ constexpr float sinhf(float x);
74
+ constexpr long double sinhl(long double x);
75
 
76
+ constexpr floating-point-type tanh(floating-point-type x);
77
+ constexpr float tanhf(float x);
78
+ constexpr long double tanhl(long double x);
79
 
80
+ constexpr floating-point-type exp(floating-point-type x);
81
+ constexpr float expf(float x);
82
+ constexpr long double expl(long double x);
83
 
84
+ constexpr floating-point-type exp2(floating-point-type x);
85
+ constexpr float exp2f(float x);
86
+ constexpr long double exp2l(long double x);
87
+
88
+ constexpr floating-point-type expm1(floating-point-type x);
89
+ constexpr float expm1f(float x);
90
+ constexpr long double expm1l(long double x);
91
 
92
  constexpr floating-point-type frexp(floating-point-type value, int* exp);
93
  constexpr float frexpf(float value, int* exp);
94
  constexpr long double frexpl(long double value, int* exp);
95
 
 
99
 
100
  constexpr floating-point-type ldexp(floating-point-type x, int exp);
101
  constexpr float ldexpf(float x, int exp);
102
  constexpr long double ldexpl(long double x, int exp);
103
 
104
+ constexpr floating-point-type log(floating-point-type x);
105
+ constexpr float logf(float x);
106
+ constexpr long double logl(long double x);
107
 
108
+ constexpr floating-point-type log10(floating-point-type x);
109
+ constexpr float log10f(float x);
110
+ constexpr long double log10l(long double x);
111
 
112
+ constexpr floating-point-type log1p(floating-point-type x);
113
+ constexpr float log1pf(float x);
114
+ constexpr long double log1pl(long double x);
115
 
116
+ constexpr floating-point-type log2(floating-point-type x);
117
+ constexpr float log2f(float x);
118
+ constexpr long double log2l(long double x);
119
 
120
  constexpr floating-point-type logb(floating-point-type x);
121
  constexpr float logbf(float x);
122
  constexpr long double logbl(long double x);
123
 
 
131
 
132
  constexpr floating-point-type scalbln(floating-point-type x, long int n);
133
  constexpr float scalblnf(float x, long int n);
134
  constexpr long double scalblnl(long double x, long int n);
135
 
136
+ constexpr floating-point-type cbrt(floating-point-type x);
137
+ constexpr float cbrtf(float x);
138
+ constexpr long double cbrtl(long double x);
139
 
140
  // [c.math.abs], absolute values
141
+ constexpr int abs(int j); // freestanding
142
+ constexpr long int abs(long int j); // freestanding
143
+ constexpr long long int abs(long long int j); // freestanding
144
+ constexpr floating-point-type abs(floating-point-type j); // freestanding-deleted
145
 
146
  constexpr floating-point-type fabs(floating-point-type x);
147
  constexpr float fabsf(float x);
148
  constexpr long double fabsl(long double x);
149
 
150
+ constexpr floating-point-type hypot(floating-point-type x, floating-point-type y);
151
+ constexpr float hypotf(float x, float y);
152
+ constexpr long double hypotl(long double x, long double y);
153
 
154
  // [c.math.hypot3], three-dimensional hypotenuse
155
+ constexpr floating-point-type hypot(floating-point-type x, floating-point-type y,
156
  floating-point-type z);
157
 
158
+ constexpr floating-point-type pow(floating-point-type x, floating-point-type y);
159
+ constexpr float powf(float x, float y);
160
+ constexpr long double powl(long double x, long double y);
161
 
162
+ constexpr floating-point-type sqrt(floating-point-type x);
163
+ constexpr float sqrtf(float x);
164
+ constexpr long double sqrtl(long double x);
165
 
166
+ constexpr floating-point-type erf(floating-point-type x);
167
+ constexpr float erff(float x);
168
+ constexpr long double erfl(long double x);
169
 
170
+ constexpr floating-point-type erfc(floating-point-type x);
171
+ constexpr float erfcf(float x);
172
+ constexpr long double erfcl(long double x);
173
 
174
+ constexpr floating-point-type lgamma(floating-point-type x);
175
+ constexpr float lgammaf(float x);
176
+ constexpr long double lgammal(long double x);
177
 
178
+ constexpr floating-point-type tgamma(floating-point-type x);
179
+ constexpr float tgammaf(float x);
180
+ constexpr long double tgammal(long double x);
181
 
182
  constexpr floating-point-type ceil(floating-point-type x);
183
  constexpr float ceilf(float x);
184
  constexpr long double ceill(long double x);
185
 
 
245
 
246
  constexpr floating-point-type nexttoward(floating-point-type x, long double y);
247
  constexpr float nexttowardf(float x, long double y);
248
  constexpr long double nexttowardl(long double x, long double y);
249
 
250
+ constexpr floating-point-type nextup(floating-point-type x);
251
+ constexpr float nextupf(float x);
252
+ constexpr long double nextupl(long double x);
253
+
254
+ constexpr floating-point-type nextdown(floating-point-type x);
255
+ constexpr float nextdownf(float x);
256
+ constexpr long double nextdownl(long double x);
257
+
258
  constexpr floating-point-type fdim(floating-point-type x, floating-point-type y);
259
  constexpr float fdimf(float x, float y);
260
  constexpr long double fdiml(long double x, long double y);
261
 
262
  constexpr floating-point-type fmax(floating-point-type x, floating-point-type y);
 
265
 
266
  constexpr floating-point-type fmin(floating-point-type x, floating-point-type y);
267
  constexpr float fminf(float x, float y);
268
  constexpr long double fminl(long double x, long double y);
269
 
270
+ constexpr floating-point-type fmaximum(floating-point-type x, floating-point-type y);
271
+ constexpr floating-point-type fmaximum_num(floating-point-type x, floating-point-type y);
272
+ constexpr floating-point-type fminimum(floating-point-type x, floating-point-type y);
273
+ constexpr floating-point-type fminimum_num(floating-point-type x, floating-point-type y);
274
+
275
  constexpr floating-point-type fma(floating-point-type x, floating-point-type y,
276
  floating-point-type z);
277
  constexpr float fmaf(float x, float y, float z);
278
  constexpr long double fmal(long double x, long double y, long double z);
279
 
 
405
  float sph_neumannf(unsigned n, float x);
406
  long double sph_neumannl(unsigned n, long double x);
407
  }
408
  ```
409
 
410
+ The contents and meaning of the header `<cmath>` are a subset of the C
411
+ standard library header `<math.h>` and only the declarations shown in
412
+ the synopsis above are present, with the addition of a three-dimensional
413
+ hypotenuse function [[c.math.hypot3]], a linear interpolation function
414
+ [[c.math.lerp]], and the mathematical special functions described in
415
+ [[sf.cmath]].
416
 
417
  [*Note 1*: Several functions have additional overloads in this
418
  document, but they have the same behavior as in the C standard library
419
  [[library.c]]. — *end note*]
420
 
421
  For each function with at least one parameter of type
422
+ `floating-point-type`, the implementation provides an overload for each
423
  cv-unqualified floating-point type [[basic.fundamental]] where all uses
424
+ of `floating-point-type` in the function signature are replaced with
425
  that floating-point type.
426
 
427
  For each function with at least one parameter of type
428
+ `floating-point-type` other than `abs`, the implementation also provides
429
  additional overloads sufficient to ensure that, if every argument
430
+ corresponding to a `floating-point-type` parameter has arithmetic type,
431
  then every such argument is effectively cast to the floating-point type
432
  with the greatest floating-point conversion rank and greatest
433
  floating-point conversion subrank among the types of all such arguments,
434
  where arguments of integer type are considered to have the same
435
  floating-point conversion rank as `double`. If no such floating-point
436
  type with the greatest rank and subrank exists, then overload resolution
437
  does not result in a usable candidate [[over.match.general]] from the
438
  overloads provided by the implementation.
439
 
440
  An invocation of `nexttoward` is ill-formed if the argument
441
+ corresponding to the `floating-point-type` parameter has extended
442
  floating-point type.
443
 
444
  See also: ISO C 7.12
445