modernc.org/cc@v1.0.1/v2/headers/linux_arm/usr/include/arm-linux-gnueabihf/bits/mathcalls.h (about) 1 /* Prototype declarations for math functions; helper file for <math.h>. 2 Copyright (C) 1996-2016 Free Software Foundation, Inc. 3 This file is part of the GNU C Library. 4 5 The GNU C Library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 The GNU C Library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with the GNU C Library; if not, see 17 <http://www.gnu.org/licenses/>. */ 18 19 /* NOTE: Because of the special way this file is used by <math.h>, this 20 file must NOT be protected from multiple inclusion as header files 21 usually are. 22 23 This file provides prototype declarations for the math functions. 24 Most functions are declared using the macro: 25 26 __MATHCALL (NAME,[_r], (ARGS...)); 27 28 This means there is a function `NAME' returning `double' and a function 29 `NAMEf' returning `float'. Each place `_Mdouble_' appears in the 30 prototype, that is actually `double' in the prototype for `NAME' and 31 `float' in the prototype for `NAMEf'. Reentrant variant functions are 32 called `NAME_r' and `NAMEf_r'. 33 34 Functions returning other types like `int' are declared using the macro: 35 36 __MATHDECL (TYPE, NAME,[_r], (ARGS...)); 37 38 This is just like __MATHCALL but for a function returning `TYPE' 39 instead of `_Mdouble_'. In all of these cases, there is still 40 both a `NAME' and a `NAMEf' that takes `float' arguments. 41 42 Note that there must be no whitespace before the argument passed for 43 NAME, to make token pasting work with -traditional. */ 44 45 #ifndef _MATH_H 46 #error "Never include <bits/mathcalls.h> directly; include <math.h> instead." 47 #endif 48 49 /* Trigonometric functions. */ 50 51 _Mdouble_BEGIN_NAMESPACE 52 /* Arc cosine of X. */ 53 __MATHCALL(acos,, (_Mdouble_ __x)); 54 /* Arc sine of X. */ 55 __MATHCALL(asin,, (_Mdouble_ __x)); 56 /* Arc tangent of X. */ 57 __MATHCALL(atan,, (_Mdouble_ __x)); 58 /* Arc tangent of Y/X. */ 59 __MATHCALL(atan2,, (_Mdouble_ __y, _Mdouble_ __x)); 60 61 /* Cosine of X. */ 62 __MATHCALL_VEC(cos,, (_Mdouble_ __x)); 63 /* Sine of X. */ 64 __MATHCALL_VEC(sin,, (_Mdouble_ __x)); 65 /* Tangent of X. */ 66 __MATHCALL(tan,, (_Mdouble_ __x)); 67 68 /* Hyperbolic functions. */ 69 70 /* Hyperbolic cosine of X. */ 71 __MATHCALL(cosh,, (_Mdouble_ __x)); 72 /* Hyperbolic sine of X. */ 73 __MATHCALL(sinh,, (_Mdouble_ __x)); 74 /* Hyperbolic tangent of X. */ 75 __MATHCALL(tanh,, (_Mdouble_ __x)); 76 _Mdouble_END_NAMESPACE 77 #ifdef __USE_GNU 78 /* Cosine and sine of X. */ 79 __MATHDECL_VEC(void, sincos,, (_Mdouble_ __x, _Mdouble_ * __sinx, _Mdouble_ * __cosx)); 80 #endif 81 82 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 83 __BEGIN_NAMESPACE_C99 84 /* Hyperbolic arc cosine of X. */ 85 __MATHCALL(acosh,, (_Mdouble_ __x)); 86 /* Hyperbolic arc sine of X. */ 87 __MATHCALL(asinh,, (_Mdouble_ __x)); 88 /* Hyperbolic arc tangent of X. */ 89 __MATHCALL(atanh,, (_Mdouble_ __x)); 90 __END_NAMESPACE_C99 91 #endif 92 /* Exponential and logarithmic functions. */ 93 _Mdouble_BEGIN_NAMESPACE 94 /* Exponential function of X. */ 95 __MATHCALL_VEC(exp,, (_Mdouble_ __x)); 96 97 /* Break VALUE into a normalized fraction and an integral power of 2. */ 98 __MATHCALL(frexp,, (_Mdouble_ __x, int *__exponent)); 99 100 /* X times (two to the EXP power). */ 101 __MATHCALL(ldexp,, (_Mdouble_ __x, int __exponent)); 102 103 /* Natural logarithm of X. */ 104 __MATHCALL_VEC(log,, (_Mdouble_ __x)); 105 106 /* Base-ten logarithm of X. */ 107 __MATHCALL(log10,, (_Mdouble_ __x)); 108 109 /* Break VALUE into integral and fractional parts. */ 110 __MATHCALL(modf,, (_Mdouble_ __x, _Mdouble_ * __iptr)) __nonnull((2)); 111 _Mdouble_END_NAMESPACE 112 #ifdef __USE_GNU 113 /* A function missing in all standards: compute exponent to base ten. */ 114 __MATHCALL(exp10,, (_Mdouble_ __x)); 115 /* Another name occasionally used. */ 116 __MATHCALL(pow10,, (_Mdouble_ __x)); 117 #endif 118 119 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 120 __BEGIN_NAMESPACE_C99 121 /* Return exp(X) - 1. */ 122 __MATHCALL(expm1,, (_Mdouble_ __x)); 123 124 /* Return log(1 + X). */ 125 __MATHCALL(log1p,, (_Mdouble_ __x)); 126 127 /* Return the base 2 signed integral exponent of X. */ 128 __MATHCALL(logb,, (_Mdouble_ __x)); 129 __END_NAMESPACE_C99 130 #endif 131 #ifdef __USE_ISOC99 132 __BEGIN_NAMESPACE_C99 133 /* Compute base-2 exponential of X. */ 134 __MATHCALL(exp2,, (_Mdouble_ __x)); 135 136 /* Compute base-2 logarithm of X. */ 137 __MATHCALL(log2,, (_Mdouble_ __x)); 138 __END_NAMESPACE_C99 139 #endif 140 /* Power functions. */ 141 _Mdouble_BEGIN_NAMESPACE 142 /* Return X to the Y power. */ 143 __MATHCALL_VEC(pow,, (_Mdouble_ __x, _Mdouble_ __y)); 144 145 /* Return the square root of X. */ 146 __MATHCALL(sqrt,, (_Mdouble_ __x)); 147 _Mdouble_END_NAMESPACE 148 #if defined __USE_XOPEN || defined __USE_ISOC99 149 __BEGIN_NAMESPACE_C99 150 /* Return `sqrt(X*X + Y*Y)'. */ 151 __MATHCALL(hypot,, (_Mdouble_ __x, _Mdouble_ __y)); 152 __END_NAMESPACE_C99 153 #endif 154 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 155 __BEGIN_NAMESPACE_C99 156 /* Return the cube root of X. */ 157 __MATHCALL(cbrt,, (_Mdouble_ __x)); 158 __END_NAMESPACE_C99 159 #endif 160 /* Nearest integer, absolute value, and remainder functions. */ 161 _Mdouble_BEGIN_NAMESPACE 162 /* Smallest integral value not less than X. */ 163 __MATHCALLX(ceil,, (_Mdouble_ __x), (__const__)); 164 165 /* Absolute value of X. */ 166 __MATHCALLX(fabs,, (_Mdouble_ __x), (__const__)); 167 168 /* Largest integer not greater than X. */ 169 __MATHCALLX(floor,, (_Mdouble_ __x), (__const__)); 170 171 /* Floating-point modulo remainder of X/Y. */ 172 __MATHCALL(fmod,, (_Mdouble_ __x, _Mdouble_ __y)); 173 174 /* Return 0 if VALUE is finite or NaN, +1 if it 175 is +Infinity, -1 if it is -Infinity. */ 176 __MATHDECL_1(int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); 177 178 /* Return nonzero if VALUE is finite and not NaN. */ 179 __MATHDECL_1(int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); 180 _Mdouble_END_NAMESPACE 181 #ifdef __USE_MISC 182 #if (!defined __cplusplus \ 183 || __cplusplus < 201103L /* isinf conflicts with C++11. */ \ 184 || __MATH_DECLARING_DOUBLE == 0) /* isinff or isinfl don't. */ 185 /* Return 0 if VALUE is finite or NaN, +1 if it 186 is +Infinity, -1 if it is -Infinity. */ 187 __MATHDECL_1(int, isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); 188 #endif 189 190 /* Return nonzero if VALUE is finite and not NaN. */ 191 __MATHDECL_1(int, finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); 192 193 /* Return the remainder of X/Y. */ 194 __MATHCALL(drem,, (_Mdouble_ __x, _Mdouble_ __y)); 195 196 /* Return the fractional part of X after dividing out `ilogb (X)'. */ 197 __MATHCALL(significand,, (_Mdouble_ __x)); 198 #endif /* Use misc. */ 199 200 #ifdef __USE_ISOC99 201 __BEGIN_NAMESPACE_C99 202 /* Return X with its signed changed to Y's. */ 203 __MATHCALLX(copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); 204 __END_NAMESPACE_C99 205 #endif 206 #ifdef __USE_ISOC99 207 __BEGIN_NAMESPACE_C99 208 /* Return representation of qNaN for double type. */ 209 __MATHCALLX(nan,, (const char *__tagb), (__const__)); 210 __END_NAMESPACE_C99 211 #endif 212 /* Return nonzero if VALUE is not a number. */ 213 __MATHDECL_1(int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); 214 215 #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) 216 #if (!defined __cplusplus \ 217 || __cplusplus < 201103L /* isnan conflicts with C++11. */ \ 218 || __MATH_DECLARING_DOUBLE == 0) /* isnanf or isnanl don't. */ 219 /* Return nonzero if VALUE is not a number. */ 220 __MATHDECL_1(int, isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); 221 #endif 222 #endif 223 224 #if defined __USE_MISC || (defined __USE_XOPEN && __MATH_DECLARING_DOUBLE) 225 /* Bessel functions. */ 226 __MATHCALL(j0,, (_Mdouble_)); 227 __MATHCALL(j1,, (_Mdouble_)); 228 __MATHCALL(jn,, (int, _Mdouble_)); 229 __MATHCALL(y0,, (_Mdouble_)); 230 __MATHCALL(y1,, (_Mdouble_)); 231 __MATHCALL(yn,, (int, _Mdouble_)); 232 #endif 233 234 #if defined __USE_XOPEN || defined __USE_ISOC99 235 __BEGIN_NAMESPACE_C99 236 /* Error and gamma functions. */ 237 __MATHCALL(erf,, (_Mdouble_)); 238 __MATHCALL(erfc,, (_Mdouble_)); 239 __MATHCALL(lgamma,, (_Mdouble_)); 240 __END_NAMESPACE_C99 241 #endif 242 #ifdef __USE_ISOC99 243 __BEGIN_NAMESPACE_C99 244 /* True gamma function. */ 245 __MATHCALL(tgamma,, (_Mdouble_)); 246 __END_NAMESPACE_C99 247 #endif 248 #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) 249 /* Obsolete alias for `lgamma'. */ 250 __MATHCALL(gamma,, (_Mdouble_)); 251 #endif 252 253 #ifdef __USE_MISC 254 /* Reentrant version of lgamma. This function uses the global variable 255 `signgam'. The reentrant version instead takes a pointer and stores 256 the value through it. */ 257 __MATHCALL(lgamma, _r, (_Mdouble_, int *__signgamp)); 258 #endif 259 260 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 261 __BEGIN_NAMESPACE_C99 262 /* Return the integer nearest X in the direction of the 263 prevailing rounding mode. */ 264 __MATHCALL(rint,, (_Mdouble_ __x)); 265 266 /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ 267 __MATHCALLX(nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); 268 #if defined __USE_ISOC99 && !defined __LDBL_COMPAT 269 __MATHCALLX(nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); 270 #endif 271 272 #ifdef __USE_GNU 273 /* Return X - epsilon. */ 274 __MATHCALL(nextdown,, (_Mdouble_ __x)); 275 /* Return X + epsilon. */ 276 __MATHCALL(nextup,, (_Mdouble_ __x)); 277 #endif 278 279 /* Return the remainder of integer divison X / Y with infinite precision. */ 280 __MATHCALL(remainder,, (_Mdouble_ __x, _Mdouble_ __y)); 281 282 #ifdef __USE_ISOC99 283 /* Return X times (2 to the Nth power). */ 284 __MATHCALL(scalbn,, (_Mdouble_ __x, int __n)); 285 #endif 286 287 /* Return the binary exponent of X, which must be nonzero. */ 288 __MATHDECL(int, ilogb,, (_Mdouble_ __x)); 289 #endif 290 291 #ifdef __USE_ISOC99 292 /* Return X times (2 to the Nth power). */ 293 __MATHCALL(scalbln,, (_Mdouble_ __x, long int __n)); 294 295 /* Round X to integral value in floating-point format using current 296 rounding direction, but do not raise inexact exception. */ 297 __MATHCALL(nearbyint,, (_Mdouble_ __x)); 298 299 /* Round X to nearest integral value, rounding halfway cases away from 300 zero. */ 301 __MATHCALLX(round,, (_Mdouble_ __x), (__const__)); 302 303 /* Round X to the integral value in floating-point format nearest but 304 not larger in magnitude. */ 305 __MATHCALLX(trunc,, (_Mdouble_ __x), (__const__)); 306 307 /* Compute remainder of X and Y and put in *QUO a value with sign of x/y 308 and magnitude congruent `mod 2^n' to the magnitude of the integral 309 quotient x/y, with n >= 3. */ 310 __MATHCALL(remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)); 311 312 /* Conversion functions. */ 313 314 /* Round X to nearest integral value according to current rounding 315 direction. */ 316 __MATHDECL(long int, lrint,, (_Mdouble_ __x)); 317 __extension__ __MATHDECL(long long int, llrint,, (_Mdouble_ __x)); 318 319 /* Round X to nearest integral value, rounding halfway cases away from 320 zero. */ 321 __MATHDECL(long int, lround,, (_Mdouble_ __x)); 322 __extension__ __MATHDECL(long long int, llround,, (_Mdouble_ __x)); 323 324 /* Return positive difference between X and Y. */ 325 __MATHCALL(fdim,, (_Mdouble_ __x, _Mdouble_ __y)); 326 327 /* Return maximum numeric value from X and Y. */ 328 __MATHCALLX(fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); 329 330 /* Return minimum numeric value from X and Y. */ 331 __MATHCALLX(fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); 332 333 /* Classify given number. */ 334 __MATHDECL_1(int, __fpclassify,, (_Mdouble_ __value)) 335 __attribute__ ((__const__)); 336 337 /* Test for negative number. */ 338 __MATHDECL_1(int, __signbit,, (_Mdouble_ __value)) 339 __attribute__ ((__const__)); 340 341 /* Multiply-add function computed as a ternary operation. */ 342 __MATHCALL(fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); 343 #endif /* Use ISO C99. */ 344 345 #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 346 __END_NAMESPACE_C99 347 #endif 348 #ifdef __USE_GNU 349 /* Test for signaling NaN. */ 350 __MATHDECL_1(int, __issignaling,, (_Mdouble_ __value)) 351 __attribute__ ((__const__)); 352 #endif 353 354 #if defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ 355 && __MATH_DECLARING_DOUBLE \ 356 && !defined __USE_XOPEN2K8) 357 /* Return X times (2 to the Nth power). */ 358 __MATHCALL(scalb,, (_Mdouble_ __x, _Mdouble_ __n)); 359 #endif