forked from p12tic/cppreference-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmath
More file actions
306 lines (264 loc) · 9.07 KB
/
cmath
File metadata and controls
306 lines (264 loc) · 9.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
/* Copyright (C) 2015 Povilas Kanapickas <povilas@radix.lt>
This file is part of cppreference-doc
This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
Unported License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
*/
#ifndef CPPREFERENCE_CMATH_H
#define CPPREFERENCE_CMATH_H
namespace std {
#define HUGE_VAL 0
#if CPPREFERENCE_STDVER>= 2011
#define HUGE_VALF 0
#define HUGE_VALL 0
#define INFINITY 0
#define NAN 0
#define MATH_ERRNO 0
#define MATH_ERREXCEPT 0
#define math_errhandling 0
#define FP_NORMAL 0
#define FP_SUBNORMAL 0
#define FP_ZERO 0
#define FP_INFINITE 0
#define FP_NAN 0
typedef float float_t;
typedef double double_t;
#endif // CPPREFERENCE_STDVER>= 2011
// Workaround system headers being inluded and defining isnan
#ifdef isnan
#undef isnan
#endif
float abs(float arg);
double abs(double arg);
long double abs(long double arg);
float fabs(float arg);
double fabs(double arg);
long double fabs(long double arg);
float fmod(float x, float y);
double fmod(double x, double y);
long double fmod(long double x, long double y);
#if CPPREFERENCE_STDVER>= 2011
float remainder(float x, float y);
double remainder(double x, double y);
long double remainder(long double x, long double y);
float remquo(float x, float y, int* quo);
double remquo(double x, double y, int* quo);
long double remquo(long double x, long double y, int* quo);
float fma(float x, float y, float z);
double fma(double x, double y, double z);
long double fma(long double x, long double y, long double z);
float fmax(float x, float y);
double fmax(double x, double y);
long double fmax(long double x, long double y);
float fmin(float x, float y);
double fmin(double x, double y);
long double fmin(long double x, long double y);
float fdim(float x, float y);
double fdim(double x, double y);
long double fdim(long double x, long double y);
float nanf(const char* arg);
double nan(const char* arg);
long double nanl(const char* arg);
#endif // CPPREFERENCE_STDVER>= 2011
float exp(float arg);
double exp(double arg);
long double exp(long double arg);
#if CPPREFERENCE_STDVER>= 2011
double exp2(double n);
float exp2(float n);
long double exp2(long double n);
float expm1(float arg);
double expm1(double arg);
long double expm1(long double arg);
#endif // CPPREFERENCE_STDVER>= 2011
float log(float arg);
double log(double arg);
long double log(long double arg);
float log10(float arg);
double log10(double arg);
long double log10(long double arg);
#if CPPREFERENCE_STDVER>= 2011
float log2(float arg);
double log2(double arg);
long double log2(long double arg);
float log1p(float arg);
double log1p(double arg);
long double log1p(long double arg);
#endif // CPPREFERENCE_STDVER>= 2011
float pow(float base, float exp);
double pow(double base, double exp);
long double pow(long double base, long double exp);
float pow(float base, int iexp);
double pow(double base, int iexp);
long double pow(long double base, int iexp);
float sqrt(float arg);
double sqrt(double arg);
long double sqrt(long double arg);
#if CPPREFERENCE_STDVER>= 2011
float cbrt(float arg);
double cbrt(double arg);
long double cbrt(long double arg);
float hypot(float x, float y);
double hypot(double x, double y);
long double hypot(long double x, long double y);
#endif // CPPREFERENCE_STDVER>= 2011
float sin(float arg);
double sin(double arg);
long double sin(long double arg);
float cos(float arg);
double cos(double arg);
long double cos(long double arg);
float tan(float arg);
double tan(double arg);
long double tan(long double arg);
float asin(float arg);
double asin(double arg);
long double asin(long double arg);
float acos(float arg);
double acos(double arg);
long double acos(long double arg);
float atan(float arg);
double atan(double arg);
long double atan(long double arg);
float atan2(float y, float x);
double atan2(double y, double x);
long double atan2(long double y, long double x);
float sinh(float arg);
double sinh(double arg);
long double sinh(long double arg);
float cosh(float arg);
double cosh(double arg);
long double cosh(long double arg);
float tanh(float arg);
double tanh(double arg);
long double tanh(long double arg);
#if CPPREFERENCE_STDVER>= 2011
float asinh(float arg);
double asinh(double arg);
long double asinh(long double arg);
float acosh(float arg);
double acosh(double arg);
long double acosh(long double arg);
float atanh(float arg);
double atanh(double arg);
long double atanh(long double arg);
float erf(float arg);
double erf(double arg);
long double erf(long double arg);
float erfc(float arg);
double erfc(double arg);
long double erfc(long double arg);
float tgamma(float arg);
double tgamma(double arg);
long double tgamma(long double arg);
float lgamma(float arg);
double lgamma(double arg);
long double lgamma(long double arg);
#endif // CPPREFERENCE_STDVER>= 2011
float ceil(float arg);
double ceil(double arg);
long double ceil(long double arg);
float floor(float arg);
double floor(double arg);
long double floor(long double arg);
float trunc(float arg);
double trunc(double arg);
long double trunc(long double arg);
#if CPPREFERENCE_STDVER>= 2011
float round(float arg);
double round(double arg);
long double round(long double arg);
long lround(float arg);
long lround(double arg);
long lround(long double arg);
long long llround(float arg);
long long llround(double arg);
long long llround(long double arg);
float nearbyint(float arg);
double nearbyint(double arg);
long double nearbyint(long double arg);
float rint(float arg);
double rint(double arg);
long double rint(long double arg);
long lrint(float arg);
long lrint(double arg);
long lrint(long double arg);
long long llrint(float arg);
long long llrint(double arg);
long long llrint(long double arg);
#endif // CPPREFERENCE_STDVER>= 2011
float frexp(float arg, int* exp);
double frexp(double arg, int* exp);
long double frexp(long double arg, int* exp);
float ldexp(float x, int exp);
double ldexp(double x, int exp);
long double ldexp(long double x, int exp);
float modf(float x, float* iptr);
double modf(double x, double* iptr);
long double modf(long double x, long double* iptr);
#if CPPREFERENCE_STDVER>= 2011
float scalbn(float x, int exp);
double scalbn(double x, int exp);
long double scalbn(long double x, int exp);
float scalbln(float x, long exp);
double scalbln(double x, long exp);
long double scalbln(long double x, long exp);
int ilogb(float arg);
int ilogb(double arg);
int ilogb(long double arg);
float logb(float arg);
double logb(double arg);
long double logb(long double arg);
float nextafter(float from, float to);
double nextafter(double from, double to);
long double nextafter(long double from, long double to);
float nexttoward(float from, long double to);
double nexttoward(double from, long double to);
long double nexttoward(long double from, long double to);
float copysign(float x, float y);
double copysign(double x, double y);
long double copysign(long double x, long double y);
int fpclassify(float arg);
int fpclassify(double arg);
int fpclassify(long double arg);
bool isfinite(float arg);
bool isfinite(double arg);
bool isfinite(long double arg);
bool isinf(float arg);
bool isinf(double arg);
bool isinf(long double arg);
bool isnan(float arg);
bool isnan(double arg);
bool isnan(long double arg);
bool isnormal(float arg);
bool isnormal(double arg);
bool isnormal(long double arg);
bool signbit(float arg);
bool signbit(double arg);
bool signbit(long double arg);
bool isgreater(float x, float y);
bool isgreater(double x, double y);
bool isgreater(long double x, long double y);
bool isgreaterequal(float x, float y);
bool isgreaterequal(double x, double y);
bool isgreaterequal(long double x, long double y);
bool isless(float x, float y);
bool isless(double x, double y);
bool isless(long double x, long double y);
bool islessequal(float x, float y);
bool islessequal(double x, double y);
bool islessequal(long double x, long double y);
bool islessgreater(float x, float y);
bool islessgreater(double x, double y);
bool islessgreater(long double x, long double y);
bool isunordered(float x, float y);
bool isunordered(double x, double y);
bool isunordered(long double x, long double y);
#endif // CPPREFERENCE_STDVER>= 2011
} // namespace std
#endif // CPPREFERENCE_CMATH_H