| 1 | /*
|
|---|
| 2 | * ====================================================
|
|---|
| 3 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|---|
| 4 | *
|
|---|
| 5 | * Developed at SunPro, a Sun Microsystems, Inc. business.
|
|---|
| 6 | * Permission to use, copy, modify, and distribute this
|
|---|
| 7 | * software is freely granted, provided that this notice
|
|---|
| 8 | * is preserved.
|
|---|
| 9 | * ====================================================
|
|---|
| 10 | */
|
|---|
| 11 |
|
|---|
| 12 | /*
|
|---|
| 13 | * from: @(#)fdlibm.h 5.1 93/09/24
|
|---|
| 14 | * $FreeBSD: src/lib/msun/src/math.h,v 1.61 2005/04/16 21:12:47 das Exp $
|
|---|
| 15 | */
|
|---|
| 16 |
|
|---|
| 17 | /** @file
|
|---|
| 18 | * FreeBSD HEAD 2005-06-xx
|
|---|
| 19 | */
|
|---|
| 20 |
|
|---|
| 21 | #ifndef _MATH_H_
|
|---|
| 22 | #define _MATH_H_
|
|---|
| 23 |
|
|---|
| 24 | #include <sys/cdefs.h>
|
|---|
| 25 | #include <sys/_types.h>
|
|---|
| 26 | #include <machine/_limits.h>
|
|---|
| 27 |
|
|---|
| 28 | /*
|
|---|
| 29 | * ANSI/POSIX
|
|---|
| 30 | */
|
|---|
| 31 | extern const union __infinity_un {
|
|---|
| 32 | unsigned char __uc[8];
|
|---|
| 33 | double __ud;
|
|---|
| 34 | } __infinity;
|
|---|
| 35 |
|
|---|
| 36 | extern const union __nan_un {
|
|---|
| 37 | unsigned char __uc[sizeof(float)];
|
|---|
| 38 | float __uf;
|
|---|
| 39 | } __nan;
|
|---|
| 40 |
|
|---|
| 41 | #if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
|
|---|
| 42 | #define __MATH_BUILTIN_CONSTANTS
|
|---|
| 43 | #endif
|
|---|
| 44 |
|
|---|
| 45 | #if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER)
|
|---|
| 46 | #define __MATH_BUILTIN_RELOPS
|
|---|
| 47 | #endif
|
|---|
| 48 |
|
|---|
| 49 | #ifdef __MATH_BUILTIN_CONSTANTS
|
|---|
| 50 | #define HUGE_VAL __builtin_huge_val()
|
|---|
| 51 | #else
|
|---|
| 52 | #define HUGE_VAL (__infinity.__ud)
|
|---|
| 53 | #endif
|
|---|
| 54 |
|
|---|
| 55 | #if __ISO_C_VISIBLE >= 1999
|
|---|
| 56 | #define FP_ILOGB0 (-__INT_MAX)
|
|---|
| 57 | #define FP_ILOGBNAN __INT_MAX
|
|---|
| 58 |
|
|---|
| 59 | #ifdef __MATH_BUILTIN_CONSTANTS
|
|---|
| 60 | #define HUGE_VALF __builtin_huge_valf()
|
|---|
| 61 | #define HUGE_VALL __builtin_huge_vall()
|
|---|
| 62 | #define INFINITY __builtin_inf()
|
|---|
| 63 | #define NAN __builtin_nan("")
|
|---|
| 64 | #else
|
|---|
| 65 | #define HUGE_VALF (float)HUGE_VAL
|
|---|
| 66 | #define HUGE_VALL (long double)HUGE_VAL
|
|---|
| 67 | #define INFINITY HUGE_VALF
|
|---|
| 68 | #define NAN (__nan.__uf)
|
|---|
| 69 | #endif /* __MATH_BUILTIN_CONSTANTS */
|
|---|
| 70 |
|
|---|
| 71 | #define MATH_ERRNO 1
|
|---|
| 72 | #define MATH_ERREXCEPT 2
|
|---|
| 73 | #define math_errhandling MATH_ERREXCEPT
|
|---|
| 74 |
|
|---|
| 75 | /* XXX We need a <machine/math.h>. */
|
|---|
| 76 | #if defined(__ia64__) || defined(__sparc64__)
|
|---|
| 77 | #define FP_FAST_FMA
|
|---|
| 78 | #endif
|
|---|
| 79 | #ifdef __ia64__
|
|---|
| 80 | #define FP_FAST_FMAL
|
|---|
| 81 | #endif
|
|---|
| 82 | #define FP_FAST_FMAF
|
|---|
| 83 |
|
|---|
| 84 | /* Symbolic constants to classify floating point numbers. */
|
|---|
| 85 | #define FP_INFINITE 0x01
|
|---|
| 86 | #define FP_NAN 0x02
|
|---|
| 87 | #define FP_NORMAL 0x04
|
|---|
| 88 | #define FP_SUBNORMAL 0x08
|
|---|
| 89 | #define FP_ZERO 0x10
|
|---|
| 90 | #define fpclassify(x) \
|
|---|
| 91 | ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \
|
|---|
| 92 | : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \
|
|---|
| 93 | : __fpclassifyl(x))
|
|---|
| 94 |
|
|---|
| 95 | #define isfinite(x) \
|
|---|
| 96 | ((sizeof (x) == sizeof (float)) ? __isfinitef(x) \
|
|---|
| 97 | : (sizeof (x) == sizeof (double)) ? __isfinite(x) \
|
|---|
| 98 | : __isfinitel(x))
|
|---|
| 99 | #ifdef IN_INNOTEK_LIBC
|
|---|
| 100 | #undef isinf
|
|---|
| 101 | #define isinf(x) \
|
|---|
| 102 | ((sizeof (x) == sizeof (float)) ? __isinff(x) \
|
|---|
| 103 | : (sizeof (x) == sizeof (double)) ? _STD(isinf)(x) \
|
|---|
| 104 | : __isinfl(x))
|
|---|
| 105 | #undef isnan
|
|---|
| 106 | #define isnan(x) \
|
|---|
| 107 | ((sizeof (x) == sizeof (float)) ? isnanf(x) \
|
|---|
| 108 | : (sizeof (x) == sizeof (double)) ? _STD(isnan)(x) \
|
|---|
| 109 | : __isnanl(x))
|
|---|
| 110 | #else
|
|---|
| 111 | #define isinf(x) \
|
|---|
| 112 | ((sizeof (x) == sizeof (float)) ? __isinff(x) \
|
|---|
| 113 | : (sizeof (x) == sizeof (double)) ? isinf(x) \
|
|---|
| 114 | : __isinfl(x))
|
|---|
| 115 | #define isnan(x) \
|
|---|
| 116 | ((sizeof (x) == sizeof (float)) ? isnanf(x) \
|
|---|
| 117 | : (sizeof (x) == sizeof (double)) ? isnan(x) \
|
|---|
| 118 | : __isnanl(x))
|
|---|
| 119 | #endif
|
|---|
| 120 | #define isnormal(x) \
|
|---|
| 121 | ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \
|
|---|
| 122 | : (sizeof (x) == sizeof (double)) ? __isnormal(x) \
|
|---|
| 123 | : __isnormall(x))
|
|---|
| 124 |
|
|---|
| 125 | #ifdef __MATH_BUILTIN_RELOPS
|
|---|
| 126 | #define isgreater(x, y) __builtin_isgreater((x), (y))
|
|---|
| 127 | #define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y))
|
|---|
| 128 | #define isless(x, y) __builtin_isless((x), (y))
|
|---|
| 129 | #define islessequal(x, y) __builtin_islessequal((x), (y))
|
|---|
| 130 | #define islessgreater(x, y) __builtin_islessgreater((x), (y))
|
|---|
| 131 | #define isunordered(x, y) __builtin_isunordered((x), (y))
|
|---|
| 132 | #else
|
|---|
| 133 | #define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y))
|
|---|
| 134 | #define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y))
|
|---|
| 135 | #define isless(x, y) (!isunordered((x), (y)) && (x) < (y))
|
|---|
| 136 | #define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y))
|
|---|
| 137 | #define islessgreater(x, y) (!isunordered((x), (y)) && \
|
|---|
| 138 | ((x) > (y) || (y) > (x)))
|
|---|
| 139 | #define isunordered(x, y) (isnan(x) || isnan(y))
|
|---|
| 140 | #endif /* __MATH_BUILTIN_RELOPS */
|
|---|
| 141 |
|
|---|
| 142 | #define signbit(x) \
|
|---|
| 143 | ((sizeof (x) == sizeof (float)) ? __signbitf(x) \
|
|---|
| 144 | : (sizeof (x) == sizeof (double)) ? __signbit(x) \
|
|---|
| 145 | : __signbitl(x))
|
|---|
| 146 |
|
|---|
| 147 | typedef __double_t double_t;
|
|---|
| 148 | typedef __float_t float_t;
|
|---|
| 149 | #endif /* __ISO_C_VISIBLE >= 1999 */
|
|---|
| 150 |
|
|---|
| 151 | /*
|
|---|
| 152 | * XOPEN/SVID
|
|---|
| 153 | */
|
|---|
| 154 | #if __BSD_VISIBLE || __XSI_VISIBLE
|
|---|
| 155 | #define M_E 2.7182818284590452354 /* e */
|
|---|
| 156 | #define M_LOG2E 1.4426950408889634074 /* log 2e */
|
|---|
| 157 | #define M_LOG10E 0.43429448190325182765 /* log 10e */
|
|---|
| 158 | #define M_LN2 0.69314718055994530942 /* log e2 */
|
|---|
| 159 | #define M_LN10 2.30258509299404568402 /* log e10 */
|
|---|
| 160 | #define M_PI 3.14159265358979323846 /* pi */
|
|---|
| 161 | #define M_PI_2 1.57079632679489661923 /* pi/2 */
|
|---|
| 162 | #define M_PI_4 0.78539816339744830962 /* pi/4 */
|
|---|
| 163 | #define M_1_PI 0.31830988618379067154 /* 1/pi */
|
|---|
| 164 | #define M_2_PI 0.63661977236758134308 /* 2/pi */
|
|---|
| 165 | #define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
|
|---|
| 166 | #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
|
|---|
| 167 | #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
|---|
| 168 |
|
|---|
| 169 | #define MAXFLOAT ((float)3.40282346638528860e+38)
|
|---|
| 170 | extern int signgam;
|
|---|
| 171 | #endif /* __BSD_VISIBLE || __XSI_VISIBLE */
|
|---|
| 172 |
|
|---|
| 173 | #if __BSD_VISIBLE
|
|---|
| 174 | #if 0
|
|---|
| 175 | /* Old value from 4.4BSD-Lite math.h; this is probably better. */
|
|---|
| 176 | #define HUGE HUGE_VAL
|
|---|
| 177 | #else
|
|---|
| 178 | #define HUGE MAXFLOAT
|
|---|
| 179 | #endif
|
|---|
| 180 | #endif /* __BSD_VISIBLE */
|
|---|
| 181 |
|
|---|
| 182 | /*
|
|---|
| 183 | * Most of these functions depend on the rounding mode and have the side
|
|---|
| 184 | * effect of raising floating-point exceptions, so they are not declared
|
|---|
| 185 | * as __pure2. In C99, FENV_ACCESS affects the purity of these functions.
|
|---|
| 186 | */
|
|---|
| 187 | __BEGIN_DECLS
|
|---|
| 188 | /*
|
|---|
| 189 | * ANSI/POSIX
|
|---|
| 190 | */
|
|---|
| 191 | int __fpclassifyd(double) __pure2;
|
|---|
| 192 | int __fpclassifyf(float) __pure2;
|
|---|
| 193 | int __fpclassifyl(long double) __pure2;
|
|---|
| 194 | int __isfinitef(float) __pure2;
|
|---|
| 195 | int __isfinite(double) __pure2;
|
|---|
| 196 | int __isfinitel(long double) __pure2;
|
|---|
| 197 | int __isinff(float) __pure2;
|
|---|
| 198 | int __isinfl(long double) __pure2;
|
|---|
| 199 | int __isnanl(long double) __pure2;
|
|---|
| 200 | int __isnormalf(float) __pure2;
|
|---|
| 201 | int __isnormal(double) __pure2;
|
|---|
| 202 | int __isnormall(long double) __pure2;
|
|---|
| 203 | int __signbit(double) __pure2;
|
|---|
| 204 | int __signbitf(float) __pure2;
|
|---|
| 205 | int __signbitl(long double) __pure2;
|
|---|
| 206 |
|
|---|
| 207 | double acos(double);
|
|---|
| 208 | double asin(double);
|
|---|
| 209 | double atan(double);
|
|---|
| 210 | double atan2(double, double);
|
|---|
| 211 | double cos(double);
|
|---|
| 212 | double sin(double);
|
|---|
| 213 | double tan(double);
|
|---|
| 214 |
|
|---|
| 215 | double cosh(double);
|
|---|
| 216 | double sinh(double);
|
|---|
| 217 | double tanh(double);
|
|---|
| 218 |
|
|---|
| 219 | double exp(double);
|
|---|
| 220 | double frexp(double, int *); /* fundamentally !__pure2 */
|
|---|
| 221 | double ldexp(double, int);
|
|---|
| 222 | double log(double);
|
|---|
| 223 | double log10(double);
|
|---|
| 224 | double modf(double, double *); /* fundamentally !__pure2 */
|
|---|
| 225 |
|
|---|
| 226 | double pow(double, double);
|
|---|
| 227 | double sqrt(double);
|
|---|
| 228 |
|
|---|
| 229 | double ceil(double);
|
|---|
| 230 | double fabs(double) __pure2;
|
|---|
| 231 | double floor(double);
|
|---|
| 232 | double fmod(double, double);
|
|---|
| 233 |
|
|---|
| 234 | /*
|
|---|
| 235 | * These functions are not in C90.
|
|---|
| 236 | */
|
|---|
| 237 | #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE
|
|---|
| 238 | double acosh(double);
|
|---|
| 239 | double asinh(double);
|
|---|
| 240 | double atanh(double);
|
|---|
| 241 | double cbrt(double);
|
|---|
| 242 | double erf(double);
|
|---|
| 243 | double erfc(double);
|
|---|
| 244 | double exp2(double);
|
|---|
| 245 | double expm1(double);
|
|---|
| 246 | double fma(double, double, double);
|
|---|
| 247 | double hypot(double, double);
|
|---|
| 248 | int ilogb(double) __pure2;
|
|---|
| 249 | #ifdef IN_INNOTEK_LIBC
|
|---|
| 250 | int _STD(isinf)(double) __pure2;
|
|---|
| 251 | int _STD(isnan)(double) __pure2;
|
|---|
| 252 | #else
|
|---|
| 253 | int (isinf)(double) __pure2;
|
|---|
| 254 | int (isnan)(double) __pure2;
|
|---|
| 255 | #endif
|
|---|
| 256 | double lgamma(double);
|
|---|
| 257 | long long llrint(double);
|
|---|
| 258 | long long llround(double);
|
|---|
| 259 | double log1p(double);
|
|---|
| 260 | double logb(double);
|
|---|
| 261 | long lrint(double);
|
|---|
| 262 | long lround(double);
|
|---|
| 263 | double nextafter(double, double);
|
|---|
| 264 | double remainder(double, double);
|
|---|
| 265 | double remquo(double, double, int *);
|
|---|
| 266 | double rint(double);
|
|---|
| 267 | #endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
|
|---|
| 268 |
|
|---|
| 269 | #if __BSD_VISIBLE || __XSI_VISIBLE
|
|---|
| 270 | double j0(double);
|
|---|
| 271 | double j1(double);
|
|---|
| 272 | double jn(int, double);
|
|---|
| 273 | double scalb(double, double);
|
|---|
| 274 | double y0(double);
|
|---|
| 275 | double y1(double);
|
|---|
| 276 | double yn(int, double);
|
|---|
| 277 |
|
|---|
| 278 | #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
|
|---|
| 279 | double gamma(double);
|
|---|
| 280 | #endif
|
|---|
| 281 | #endif /* __BSD_VISIBLE || __XSI_VISIBLE */
|
|---|
| 282 |
|
|---|
| 283 | #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999
|
|---|
| 284 | double copysign(double, double) __pure2;
|
|---|
| 285 | double fdim(double, double);
|
|---|
| 286 | double fmax(double, double) __pure2;
|
|---|
| 287 | double fmin(double, double) __pure2;
|
|---|
| 288 | double nearbyint(double);
|
|---|
| 289 | double round(double);
|
|---|
| 290 | double scalbln(double, long);
|
|---|
| 291 | double scalbn(double, int);
|
|---|
| 292 | double tgamma(double);
|
|---|
| 293 | double trunc(double);
|
|---|
| 294 | #endif
|
|---|
| 295 |
|
|---|
| 296 | /*
|
|---|
| 297 | * BSD math library entry points
|
|---|
| 298 | */
|
|---|
| 299 | #if __BSD_VISIBLE
|
|---|
| 300 | double drem(double, double);
|
|---|
| 301 | int finite(double) __pure2;
|
|---|
| 302 | int isnanf(float) __pure2;
|
|---|
| 303 |
|
|---|
| 304 | /*
|
|---|
| 305 | * Reentrant version of gamma & lgamma; passes signgam back by reference
|
|---|
| 306 | * as the second argument; user must allocate space for signgam.
|
|---|
| 307 | */
|
|---|
| 308 | double gamma_r(double, int *);
|
|---|
| 309 | double lgamma_r(double, int *);
|
|---|
| 310 |
|
|---|
| 311 | /*
|
|---|
| 312 | * IEEE Test Vector
|
|---|
| 313 | */
|
|---|
| 314 | double significand(double);
|
|---|
| 315 | #endif /* __BSD_VISIBLE */
|
|---|
| 316 |
|
|---|
| 317 | /* float versions of ANSI/POSIX functions */
|
|---|
| 318 | #if __ISO_C_VISIBLE >= 1999
|
|---|
| 319 | float acosf(float);
|
|---|
| 320 | float asinf(float);
|
|---|
| 321 | float atanf(float);
|
|---|
| 322 | float atan2f(float, float);
|
|---|
| 323 | float cosf(float);
|
|---|
| 324 | float sinf(float);
|
|---|
| 325 | float tanf(float);
|
|---|
| 326 |
|
|---|
| 327 | float coshf(float);
|
|---|
| 328 | float sinhf(float);
|
|---|
| 329 | float tanhf(float);
|
|---|
| 330 |
|
|---|
| 331 | float exp2f(float);
|
|---|
| 332 | float expf(float);
|
|---|
| 333 | float expm1f(float);
|
|---|
| 334 | float frexpf(float, int *); /* fundamentally !__pure2 */
|
|---|
| 335 | int ilogbf(float) __pure2;
|
|---|
| 336 | float ldexpf(float, int);
|
|---|
| 337 | float log10f(float);
|
|---|
| 338 | float log1pf(float);
|
|---|
| 339 | float logf(float);
|
|---|
| 340 | float modff(float, float *); /* fundamentally !__pure2 */
|
|---|
| 341 |
|
|---|
| 342 | float powf(float, float);
|
|---|
| 343 | float sqrtf(float);
|
|---|
| 344 |
|
|---|
| 345 | float ceilf(float);
|
|---|
| 346 | float fabsf(float) __pure2;
|
|---|
| 347 | float floorf(float);
|
|---|
| 348 | float fmodf(float, float);
|
|---|
| 349 | float roundf(float);
|
|---|
| 350 |
|
|---|
| 351 | float erff(float);
|
|---|
| 352 | float erfcf(float);
|
|---|
| 353 | float hypotf(float, float);
|
|---|
| 354 | float lgammaf(float);
|
|---|
| 355 |
|
|---|
| 356 | float acoshf(float);
|
|---|
| 357 | float asinhf(float);
|
|---|
| 358 | float atanhf(float);
|
|---|
| 359 | float cbrtf(float);
|
|---|
| 360 | float logbf(float);
|
|---|
| 361 | float copysignf(float, float) __pure2;
|
|---|
| 362 | long long llrintf(float);
|
|---|
| 363 | long long llroundf(float);
|
|---|
| 364 | long lrintf(float);
|
|---|
| 365 | long lroundf(float);
|
|---|
| 366 | float nearbyintf(float);
|
|---|
| 367 | float nextafterf(float, float);
|
|---|
| 368 | float remainderf(float, float);
|
|---|
| 369 | float remquof(float, float, int *);
|
|---|
| 370 | float rintf(float);
|
|---|
| 371 | float scalblnf(float, long);
|
|---|
| 372 | float scalbnf(float, int);
|
|---|
| 373 | float truncf(float);
|
|---|
| 374 |
|
|---|
| 375 | float fdimf(float, float);
|
|---|
| 376 | float fmaf(float, float, float);
|
|---|
| 377 | float fmaxf(float, float) __pure2;
|
|---|
| 378 | float fminf(float, float) __pure2;
|
|---|
| 379 | #endif
|
|---|
| 380 |
|
|---|
| 381 | /*
|
|---|
| 382 | * float versions of BSD math library entry points
|
|---|
| 383 | */
|
|---|
| 384 | #if __BSD_VISIBLE
|
|---|
| 385 | float dremf(float, float);
|
|---|
| 386 | int finitef(float) __pure2;
|
|---|
| 387 | float gammaf(float);
|
|---|
| 388 | float j0f(float);
|
|---|
| 389 | float j1f(float);
|
|---|
| 390 | float jnf(int, float);
|
|---|
| 391 | float scalbf(float, float);
|
|---|
| 392 | float y0f(float);
|
|---|
| 393 | float y1f(float);
|
|---|
| 394 | float ynf(int, float);
|
|---|
| 395 |
|
|---|
| 396 | /*
|
|---|
| 397 | * Float versions of reentrant version of gamma & lgamma; passes
|
|---|
| 398 | * signgam back by reference as the second argument; user must
|
|---|
| 399 | * allocate space for signgam.
|
|---|
| 400 | */
|
|---|
| 401 | float gammaf_r(float, int *);
|
|---|
| 402 | float lgammaf_r(float, int *);
|
|---|
| 403 |
|
|---|
| 404 | /*
|
|---|
| 405 | * float version of IEEE Test Vector
|
|---|
| 406 | */
|
|---|
| 407 | float significandf(float);
|
|---|
| 408 | #endif /* __BSD_VISIBLE */
|
|---|
| 409 |
|
|---|
| 410 | /*
|
|---|
| 411 | * long double versions of ISO/POSIX math functions
|
|---|
| 412 | */
|
|---|
| 413 | #if __ISO_C_VISIBLE >= 1999
|
|---|
| 414 | #if 1 /* bird: we've got these */
|
|---|
| 415 | long double acoshl(long double);
|
|---|
| 416 | long double acosl(long double);
|
|---|
| 417 | long double asinhl(long double);
|
|---|
| 418 | long double asinl(long double);
|
|---|
| 419 | long double atan2l(long double, long double);
|
|---|
| 420 | long double atanhl(long double);
|
|---|
| 421 | long double atanl(long double);
|
|---|
| 422 | long double cbrtl(long double);
|
|---|
| 423 | #endif
|
|---|
| 424 | long double ceill(long double);
|
|---|
| 425 | long double copysignl(long double, long double) __pure2;
|
|---|
| 426 | #if 1 /* bird */
|
|---|
| 427 | long double coshl(long double);
|
|---|
| 428 | long double cosl(long double);
|
|---|
| 429 | long double erfcl(long double);
|
|---|
| 430 | long double erfl(long double);
|
|---|
| 431 | long double exp2l(long double);
|
|---|
| 432 | long double expl(long double);
|
|---|
| 433 | long double expm1l(long double);
|
|---|
| 434 | #endif
|
|---|
| 435 | long double fabsl(long double) __pure2;
|
|---|
| 436 | long double fdiml(long double, long double);
|
|---|
| 437 | long double floorl(long double);
|
|---|
| 438 | long double fmal(long double, long double, long double);
|
|---|
| 439 | long double fmaxl(long double, long double) __pure2;
|
|---|
| 440 | long double fminl(long double, long double) __pure2;
|
|---|
| 441 | #if 1 /* bird */
|
|---|
| 442 | long double fmodl(long double, long double);
|
|---|
| 443 | #endif
|
|---|
| 444 | long double frexpl(long double value, int *); /* fundamentally !__pure2 */
|
|---|
| 445 | #if 1 /* bird */
|
|---|
| 446 | long double hypotl(long double, long double);
|
|---|
| 447 | #endif
|
|---|
| 448 | int ilogbl(long double) __pure2;
|
|---|
| 449 | long double ldexpl(long double, int);
|
|---|
| 450 | #if 1 /* bird */
|
|---|
| 451 | long double lgammal(long double);
|
|---|
| 452 | long long llrintl(long double);
|
|---|
| 453 | #endif
|
|---|
| 454 | long long llroundl(long double);
|
|---|
| 455 | #if 1 /* bird */
|
|---|
| 456 | long double log10l(long double);
|
|---|
| 457 | long double log1pl(long double);
|
|---|
| 458 | long double log2l(long double);
|
|---|
| 459 | long double logbl(long double);
|
|---|
| 460 | long double logl(long double);
|
|---|
| 461 | long lrintl(long double);
|
|---|
| 462 | #endif
|
|---|
| 463 | long lroundl(long double);
|
|---|
| 464 | #if 1 /* bird */
|
|---|
| 465 | long double modfl(long double, long double *); /* fundamentally !__pure2 */
|
|---|
| 466 | long double nanl(const char *) __pure2;
|
|---|
| 467 | long double nearbyintl(long double);
|
|---|
| 468 | #endif
|
|---|
| 469 | long double nextafterl(long double, long double);
|
|---|
| 470 | double nexttoward(double, long double);
|
|---|
| 471 | float nexttowardf(float, long double);
|
|---|
| 472 | long double nexttowardl(long double, long double);
|
|---|
| 473 | #if 1 /* bird */
|
|---|
| 474 | long double powl(long double, long double);
|
|---|
| 475 | long double remainderl(long double, long double);
|
|---|
| 476 | long double remquol(long double, long double, int *);
|
|---|
| 477 | long double rintl(long double);
|
|---|
| 478 | #endif
|
|---|
| 479 | long double roundl(long double);
|
|---|
| 480 | long double scalblnl(long double, long);
|
|---|
| 481 | long double scalbnl(long double, int);
|
|---|
| 482 | #if 1 /* birdL we 've got most of these. */
|
|---|
| 483 | long double sinhl(long double);
|
|---|
| 484 | long double sinl(long double);
|
|---|
| 485 | long double sqrtl(long double);
|
|---|
| 486 | long double tanhl(long double);
|
|---|
| 487 | long double tanl(long double);
|
|---|
| 488 | long double tgammal(long double);
|
|---|
| 489 | #endif
|
|---|
| 490 | long double truncl(long double);
|
|---|
| 491 |
|
|---|
| 492 | /* bird: these were missing, gcc apparently inlines them. */
|
|---|
| 493 | double nan(const char *);
|
|---|
| 494 | float nanf(const char *);
|
|---|
| 495 |
|
|---|
| 496 | #endif /* __ISO_C_VISIBLE >= 1999 */
|
|---|
| 497 |
|
|---|
| 498 | #ifdef __USE_GNU
|
|---|
| 499 | /*
|
|---|
| 500 | * In GLIBC there are long variants of the XOPEN/SVID constant
|
|---|
| 501 | * block some pages ago. We need this to get the math tests going.
|
|---|
| 502 | */
|
|---|
| 503 | #define M_El 2.7182818284590452353602874713526625L
|
|---|
| 504 | #define M_LOG2El 1.4426950408889634073599246810018921L
|
|---|
| 505 | #define M_LOG10El 0.4342944819032518276511289189166051L
|
|---|
| 506 | #define M_LN2l 0.6931471805599453094172321214581766L
|
|---|
| 507 | #define M_LN10l 2.3025850929940456840179914546843642L
|
|---|
| 508 | #define M_PIl 3.1415926535897932384626433832795029L
|
|---|
| 509 | #define M_PI_2l 1.5707963267948966192313216916397514L
|
|---|
| 510 | #define M_PI_4l 0.7853981633974483096156608458198757L
|
|---|
| 511 | #define M_1_PIl 0.3183098861837906715377675267450287L
|
|---|
| 512 | #define M_2_PIl 0.6366197723675813430755350534900574L
|
|---|
| 513 | #define M_2_SQRTPIl 1.1283791670955125738961589031215452L
|
|---|
| 514 | #define M_SQRT2l 1.4142135623730950488016887242096981L
|
|---|
| 515 | #define M_SQRT1_2l 0.7071067811865475244008443621048490L
|
|---|
| 516 | #endif
|
|---|
| 517 |
|
|---|
| 518 | #ifdef __USE_GNU
|
|---|
| 519 |
|
|---|
| 520 | void sincos(double, double *, double *);
|
|---|
| 521 | void sincosf(float, float *, float *);
|
|---|
| 522 | void sincosl(long double, long double *, long double *);
|
|---|
| 523 | float exp10f(float);
|
|---|
| 524 | double exp10(double);
|
|---|
| 525 | long double exp10l(long double);
|
|---|
| 526 | float log2f(float);
|
|---|
| 527 | double log2(double);
|
|---|
| 528 | long double log2l(long double);
|
|---|
| 529 | float tgammaf(float);
|
|---|
| 530 | long double significandl(long double);
|
|---|
| 531 | long double j0l(long double);
|
|---|
| 532 | long double j1l(long double);
|
|---|
| 533 | long double jnl(int, long double);
|
|---|
| 534 | long double scalbl(long double, long double);
|
|---|
| 535 | long double y0l(long double);
|
|---|
| 536 | long double y1l(long double);
|
|---|
| 537 | long double ynl(int, long double);
|
|---|
| 538 | long double lgammal_r(long double,int *);
|
|---|
| 539 | long double gammal(long double);
|
|---|
| 540 | #endif
|
|---|
| 541 | __END_DECLS
|
|---|
| 542 |
|
|---|
| 543 | #endif /* !_MATH_H_ */
|
|---|