The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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 |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 14 | * $FreeBSD$ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #ifndef _MATH_H_ |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 18 | #define _MATH_H_ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 19 | |
| 20 | #include <sys/cdefs.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 21 | #include <limits.h> |
| 22 | |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 23 | __BEGIN_DECLS |
| 24 | #pragma GCC visibility push(default) |
| 25 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 26 | #define HUGE_VAL __builtin_huge_val() |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 27 | |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 28 | #if __ISO_C_VISIBLE >= 1999 |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 29 | #define FP_ILOGB0 (-INT_MAX) |
| 30 | #define FP_ILOGBNAN INT_MAX |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 31 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 32 | #define HUGE_VALF __builtin_huge_valf() |
| 33 | #define HUGE_VALL __builtin_huge_vall() |
| 34 | #define INFINITY __builtin_inff() |
| 35 | #define NAN __builtin_nanf("") |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 36 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 37 | #define MATH_ERRNO 1 |
| 38 | #define MATH_ERREXCEPT 2 |
| 39 | #define math_errhandling MATH_ERREXCEPT |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 40 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 41 | #if defined(__FP_FAST_FMA) |
| 42 | #define FP_FAST_FMA 1 |
| 43 | #endif |
| 44 | #if defined(__FP_FAST_FMAF) |
| 45 | #define FP_FAST_FMAF 1 |
| 46 | #endif |
| 47 | #if defined(__FP_FAST_FMAL) |
| 48 | #define FP_FAST_FMAL 1 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 49 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 50 | |
| 51 | /* Symbolic constants to classify floating point numbers. */ |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 52 | #define FP_INFINITE 0x01 |
| 53 | #define FP_NAN 0x02 |
| 54 | #define FP_NORMAL 0x04 |
| 55 | #define FP_SUBNORMAL 0x08 |
| 56 | #define FP_ZERO 0x10 |
| 57 | #define fpclassify(x) \ |
| 58 | __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 59 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 60 | #define isfinite(x) __builtin_isfinite(x) |
| 61 | #define isinf(x) __builtin_isinf(x) |
| 62 | #define isnan(x) __builtin_isnan(x) |
| 63 | #define isnormal(x) __builtin_isnormal(x) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 64 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 65 | #define isgreater(x, y) __builtin_isgreater((x), (y)) |
| 66 | #define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) |
| 67 | #define isless(x, y) __builtin_isless((x), (y)) |
| 68 | #define islessequal(x, y) __builtin_islessequal((x), (y)) |
| 69 | #define islessgreater(x, y) __builtin_islessgreater((x), (y)) |
| 70 | #define isunordered(x, y) __builtin_isunordered((x), (y)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 71 | |
Elliott Hughes | b662280 | 2015-08-14 14:04:30 -0700 | [diff] [blame] | 72 | #define signbit(x) \ |
| 73 | ((sizeof(x) == sizeof(float)) ? __builtin_signbitf(x) \ |
| 74 | : (sizeof(x) == sizeof(double)) ? __builtin_signbit(x) \ |
| 75 | : __builtin_signbitl(x)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 76 | |
Elliott Hughes | 9f87a0b | 2014-02-07 14:55:58 -0800 | [diff] [blame] | 77 | typedef double __double_t; |
| 78 | typedef __double_t double_t; |
| 79 | typedef float __float_t; |
| 80 | typedef __float_t float_t; |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 81 | #endif /* __ISO_C_VISIBLE >= 1999 */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 82 | |
| 83 | /* |
| 84 | * XOPEN/SVID |
| 85 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 86 | #if __BSD_VISIBLE || __XSI_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 87 | #define M_E 2.7182818284590452354 /* e */ |
| 88 | #define M_LOG2E 1.4426950408889634074 /* log 2e */ |
| 89 | #define M_LOG10E 0.43429448190325182765 /* log 10e */ |
| 90 | #define M_LN2 0.69314718055994530942 /* log e2 */ |
| 91 | #define M_LN10 2.30258509299404568402 /* log e10 */ |
| 92 | #define M_PI 3.14159265358979323846 /* pi */ |
| 93 | #define M_PI_2 1.57079632679489661923 /* pi/2 */ |
| 94 | #define M_PI_4 0.78539816339744830962 /* pi/4 */ |
| 95 | #define M_1_PI 0.31830988618379067154 /* 1/pi */ |
| 96 | #define M_2_PI 0.63661977236758134308 /* 2/pi */ |
| 97 | #define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ |
| 98 | #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ |
| 99 | #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ |
| 100 | |
| 101 | #define MAXFLOAT ((float)3.40282346638528860e+38) |
| 102 | extern int signgam; |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 103 | #endif /* __BSD_VISIBLE || __XSI_VISIBLE */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 104 | |
Elliott Hughes | 9ee6adb | 2016-03-11 14:49:13 -0800 | [diff] [blame] | 105 | #if __USE_GNU |
| 106 | #define M_El 2.718281828459045235360287471352662498L /* e */ |
| 107 | #define M_LOG2El 1.442695040888963407359924681001892137L /* log 2e */ |
| 108 | #define M_LOG10El 0.434294481903251827651128918916605082L /* log 10e */ |
| 109 | #define M_LN2l 0.693147180559945309417232121458176568L /* log e2 */ |
| 110 | #define M_LN10l 2.302585092994045684017991454684364208L /* log e10 */ |
| 111 | #define M_PIl 3.141592653589793238462643383279502884L /* pi */ |
| 112 | #define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */ |
| 113 | #define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */ |
| 114 | #define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */ |
| 115 | #define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */ |
| 116 | #define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */ |
| 117 | #define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ |
| 118 | #define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ |
| 119 | #endif |
| 120 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 121 | #if __BSD_VISIBLE |
| 122 | #if 0 |
| 123 | /* Old value from 4.4BSD-Lite math.h; this is probably better. */ |
| 124 | #define HUGE HUGE_VAL |
| 125 | #else |
| 126 | #define HUGE MAXFLOAT |
| 127 | #endif |
| 128 | #endif /* __BSD_VISIBLE */ |
| 129 | |
| 130 | /* |
| 131 | * Most of these functions depend on the rounding mode and have the side |
| 132 | * effect of raising floating-point exceptions, so they are not declared |
| 133 | * as __pure2. In C99, FENV_ACCESS affects the purity of these functions. |
| 134 | */ |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 135 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 136 | /* |
| 137 | * ANSI/POSIX |
| 138 | */ |
| 139 | int __fpclassifyd(double) __pure2; |
| 140 | int __fpclassifyf(float) __pure2; |
| 141 | int __fpclassifyl(long double) __pure2; |
| 142 | int __isfinitef(float) __pure2; |
| 143 | int __isfinite(double) __pure2; |
| 144 | int __isfinitel(long double) __pure2; |
| 145 | int __isinff(float) __pure2; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 146 | int __isinfl(long double) __pure2; |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 147 | int __isnanf(float) __pure2 __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 148 | int __isnanl(long double) __pure2; |
| 149 | int __isnormalf(float) __pure2; |
| 150 | int __isnormal(double) __pure2; |
| 151 | int __isnormall(long double) __pure2; |
| 152 | int __signbit(double) __pure2; |
| 153 | int __signbitf(float) __pure2; |
| 154 | int __signbitl(long double) __pure2; |
| 155 | |
| 156 | double acos(double); |
| 157 | double asin(double); |
| 158 | double atan(double); |
| 159 | double atan2(double, double); |
| 160 | double cos(double); |
| 161 | double sin(double); |
| 162 | double tan(double); |
| 163 | |
| 164 | double cosh(double); |
| 165 | double sinh(double); |
| 166 | double tanh(double); |
| 167 | |
| 168 | double exp(double); |
| 169 | double frexp(double, int *); /* fundamentally !__pure2 */ |
| 170 | double ldexp(double, int); |
| 171 | double log(double); |
| 172 | double log10(double); |
| 173 | double modf(double, double *); /* fundamentally !__pure2 */ |
| 174 | |
| 175 | double pow(double, double); |
| 176 | double sqrt(double); |
| 177 | |
| 178 | double ceil(double); |
| 179 | double fabs(double) __pure2; |
| 180 | double floor(double); |
| 181 | double fmod(double, double); |
| 182 | |
| 183 | /* |
| 184 | * These functions are not in C90. |
| 185 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 186 | #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 187 | double acosh(double); |
| 188 | double asinh(double); |
| 189 | double atanh(double); |
| 190 | double cbrt(double); |
| 191 | double erf(double); |
| 192 | double erfc(double); |
| 193 | double exp2(double); |
| 194 | double expm1(double); |
| 195 | double fma(double, double, double); |
| 196 | double hypot(double, double); |
| 197 | int ilogb(double) __pure2; |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 198 | int(isinf)(double) __pure2 __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 199 | int (isnan)(double) __pure2; |
| 200 | double lgamma(double); |
| 201 | long long llrint(double); |
| 202 | long long llround(double); |
| 203 | double log1p(double); |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 204 | double log2(double) __INTRODUCED_IN(18); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 205 | double logb(double); |
| 206 | long lrint(double); |
| 207 | long lround(double); |
Josh Gao | 46b4416 | 2016-05-27 11:14:16 -0700 | [diff] [blame] | 208 | |
| 209 | double nan(const char*) __pure2 __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(13) |
| 210 | __INTRODUCED_IN_X86(9); |
| 211 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 212 | double nextafter(double, double); |
| 213 | double remainder(double, double); |
| 214 | double remquo(double, double, int *); |
| 215 | double rint(double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 216 | #endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 217 | |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 218 | #if __BSD_VISIBLE || __XSI_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 219 | double j0(double); |
| 220 | double j1(double); |
| 221 | double jn(int, double); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 222 | double y0(double); |
| 223 | double y1(double); |
| 224 | double yn(int, double); |
| 225 | |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 226 | #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 227 | double gamma(double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 228 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 229 | |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 230 | #if __XSI_VISIBLE <= 600 || __BSD_VISIBLE |
| 231 | double scalb(double, double); |
| 232 | #endif |
| 233 | #endif /* __BSD_VISIBLE || __XSI_VISIBLE */ |
| 234 | |
| 235 | #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 236 | double copysign(double, double) __pure2; |
| 237 | double fdim(double, double); |
| 238 | double fmax(double, double) __pure2; |
| 239 | double fmin(double, double) __pure2; |
| 240 | double nearbyint(double); |
| 241 | double round(double); |
Josh Gao | 46b4416 | 2016-05-27 11:14:16 -0700 | [diff] [blame] | 242 | double scalbln(double, long) __INTRODUCED_IN_X86(18); |
| 243 | double scalbn(double, int); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 244 | double tgamma(double); |
| 245 | double trunc(double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 246 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 247 | |
| 248 | /* |
| 249 | * BSD math library entry points |
| 250 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 251 | #if __BSD_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 252 | double drem(double, double); |
| 253 | int finite(double) __pure2; |
| 254 | int isnanf(float) __pure2; |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 255 | long double significandl(long double) __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 256 | |
| 257 | /* |
| 258 | * Reentrant version of gamma & lgamma; passes signgam back by reference |
| 259 | * as the second argument; user must allocate space for signgam. |
| 260 | */ |
| 261 | double gamma_r(double, int *); |
| 262 | double lgamma_r(double, int *); |
| 263 | |
| 264 | /* |
| 265 | * IEEE Test Vector |
| 266 | */ |
| 267 | double significand(double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 268 | #endif /* __BSD_VISIBLE */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 269 | |
| 270 | /* float versions of ANSI/POSIX functions */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 271 | #if __ISO_C_VISIBLE >= 1999 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 272 | float acosf(float); |
| 273 | float asinf(float); |
| 274 | float atanf(float); |
| 275 | float atan2f(float, float); |
| 276 | float cosf(float); |
| 277 | float sinf(float); |
| 278 | float tanf(float); |
| 279 | |
| 280 | float coshf(float); |
| 281 | float sinhf(float); |
| 282 | float tanhf(float); |
| 283 | |
| 284 | float exp2f(float); |
| 285 | float expf(float); |
| 286 | float expm1f(float); |
| 287 | float frexpf(float, int *); /* fundamentally !__pure2 */ |
| 288 | int ilogbf(float) __pure2; |
| 289 | float ldexpf(float, int); |
| 290 | float log10f(float); |
| 291 | float log1pf(float); |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 292 | float log2f(float) __INTRODUCED_IN(18); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 293 | float logf(float); |
| 294 | float modff(float, float *); /* fundamentally !__pure2 */ |
| 295 | |
| 296 | float powf(float, float); |
| 297 | float sqrtf(float); |
| 298 | |
| 299 | float ceilf(float); |
| 300 | float fabsf(float) __pure2; |
| 301 | float floorf(float); |
| 302 | float fmodf(float, float); |
| 303 | float roundf(float); |
| 304 | |
| 305 | float erff(float); |
| 306 | float erfcf(float); |
| 307 | float hypotf(float, float); |
| 308 | float lgammaf(float); |
Josh Gao | 46b4416 | 2016-05-27 11:14:16 -0700 | [diff] [blame] | 309 | float tgammaf(float) __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(13) __INTRODUCED_IN_X86(9); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 310 | |
| 311 | float acoshf(float); |
| 312 | float asinhf(float); |
| 313 | float atanhf(float); |
| 314 | float cbrtf(float); |
| 315 | float logbf(float); |
| 316 | float copysignf(float, float) __pure2; |
| 317 | long long llrintf(float); |
| 318 | long long llroundf(float); |
| 319 | long lrintf(float); |
| 320 | long lroundf(float); |
Josh Gao | 46b4416 | 2016-05-27 11:14:16 -0700 | [diff] [blame] | 321 | float nanf(const char*) __pure2 __INTRODUCED_IN_ARM(13) __INTRODUCED_IN_MIPS(13) |
| 322 | __INTRODUCED_IN_X86(9); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 323 | float nearbyintf(float); |
| 324 | float nextafterf(float, float); |
| 325 | float remainderf(float, float); |
| 326 | float remquof(float, float, int *); |
| 327 | float rintf(float); |
Josh Gao | 46b4416 | 2016-05-27 11:14:16 -0700 | [diff] [blame] | 328 | float scalblnf(float, long) __INTRODUCED_IN_X86(18); |
| 329 | float scalbnf(float, int); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 330 | float truncf(float); |
| 331 | |
| 332 | float fdimf(float, float); |
| 333 | float fmaf(float, float, float); |
| 334 | float fmaxf(float, float) __pure2; |
| 335 | float fminf(float, float) __pure2; |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 336 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 337 | |
| 338 | /* |
| 339 | * float versions of BSD math library entry points |
| 340 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 341 | #if __BSD_VISIBLE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 342 | float dremf(float, float); |
| 343 | int finitef(float) __pure2; |
| 344 | float gammaf(float); |
| 345 | float j0f(float); |
| 346 | float j1f(float); |
| 347 | float jnf(int, float); |
| 348 | float scalbf(float, float); |
| 349 | float y0f(float); |
| 350 | float y1f(float); |
| 351 | float ynf(int, float); |
| 352 | |
| 353 | /* |
| 354 | * Float versions of reentrant version of gamma & lgamma; passes |
| 355 | * signgam back by reference as the second argument; user must |
| 356 | * allocate space for signgam. |
| 357 | */ |
| 358 | float gammaf_r(float, int *); |
| 359 | float lgammaf_r(float, int *); |
| 360 | |
| 361 | /* |
| 362 | * float version of IEEE Test Vector |
| 363 | */ |
| 364 | float significandf(float); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 365 | #endif /* __BSD_VISIBLE */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 366 | |
| 367 | /* |
| 368 | * long double versions of ISO/POSIX math functions |
| 369 | */ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 370 | #if __ISO_C_VISIBLE >= 1999 |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 371 | long double acoshl(long double) __INTRODUCED_IN(21); |
| 372 | long double acosl(long double) __INTRODUCED_IN(21); |
| 373 | long double asinhl(long double) __INTRODUCED_IN(21); |
| 374 | long double asinl(long double) __INTRODUCED_IN(21); |
| 375 | long double atan2l(long double, long double) __INTRODUCED_IN(21); |
| 376 | long double atanhl(long double) __INTRODUCED_IN(21); |
| 377 | long double atanl(long double) __INTRODUCED_IN(21); |
| 378 | long double cbrtl(long double) __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 379 | long double ceill(long double); |
| 380 | long double copysignl(long double, long double) __pure2; |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 381 | long double coshl(long double) __INTRODUCED_IN(21); |
| 382 | long double cosl(long double) __INTRODUCED_IN(21); |
| 383 | long double erfcl(long double) __INTRODUCED_IN(21); |
| 384 | long double erfl(long double) __INTRODUCED_IN(21); |
| 385 | long double exp2l(long double) __INTRODUCED_IN(21); |
| 386 | long double expl(long double) __INTRODUCED_IN(21); |
| 387 | long double expm1l(long double) __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 388 | long double fabsl(long double) __pure2; |
| 389 | long double fdiml(long double, long double); |
| 390 | long double floorl(long double); |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 391 | long double fmal(long double, long double, long double) __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 392 | long double fmaxl(long double, long double) __pure2; |
| 393 | long double fminl(long double, long double) __pure2; |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 394 | long double fmodl(long double, long double) __INTRODUCED_IN(21); |
| 395 | long double frexpl(long double value, int*) __INTRODUCED_IN(21); /* fundamentally !__pure2 */ |
| 396 | long double hypotl(long double, long double) __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 397 | int ilogbl(long double) __pure2; |
| 398 | long double ldexpl(long double, int); |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 399 | long double lgammal(long double) __INTRODUCED_IN(21); |
| 400 | long long llrintl(long double) __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 401 | long long llroundl(long double); |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 402 | long double log10l(long double) __INTRODUCED_IN(21); |
| 403 | long double log1pl(long double) __INTRODUCED_IN(21); |
| 404 | long double log2l(long double) __INTRODUCED_IN(18); |
| 405 | long double logbl(long double) __INTRODUCED_IN(18); |
| 406 | long double logl(long double) __INTRODUCED_IN(21); |
| 407 | long lrintl(long double) __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 408 | long lroundl(long double); |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 409 | long double modfl(long double, long double*) __INTRODUCED_IN(21); /* fundamentally !__pure2 */ |
| 410 | long double nanl(const char*) __pure2 __INTRODUCED_IN(13); |
| 411 | long double nearbyintl(long double) __INTRODUCED_IN(21); |
| 412 | long double nextafterl(long double, long double) __INTRODUCED_IN(21); |
| 413 | double nexttoward(double, long double) __INTRODUCED_IN(18); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 414 | float nexttowardf(float, long double); |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 415 | long double nexttowardl(long double, long double) __INTRODUCED_IN(18); |
| 416 | long double powl(long double, long double) __INTRODUCED_IN(21); |
| 417 | long double remainderl(long double, long double) __INTRODUCED_IN(21); |
| 418 | long double remquol(long double, long double, int*) __INTRODUCED_IN(21); |
| 419 | long double rintl(long double) __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 420 | long double roundl(long double); |
Josh Gao | 46b4416 | 2016-05-27 11:14:16 -0700 | [diff] [blame] | 421 | long double scalblnl(long double, long) __INTRODUCED_IN_X86(18); |
| 422 | long double scalbnl(long double, int); |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 423 | long double sinhl(long double) __INTRODUCED_IN(21); |
| 424 | long double sinl(long double) __INTRODUCED_IN(21); |
| 425 | long double sqrtl(long double) __INTRODUCED_IN(21); |
| 426 | long double tanhl(long double) __INTRODUCED_IN(21); |
| 427 | long double tanl(long double) __INTRODUCED_IN(21); |
| 428 | long double tgammal(long double) __INTRODUCED_IN(21); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 429 | long double truncl(long double); |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 430 | #endif /* __ISO_C_VISIBLE >= 1999 */ |
Elliott Hughes | b4f2f28 | 2014-05-08 21:19:12 -0700 | [diff] [blame] | 431 | |
Elliott Hughes | 7553185 | 2014-09-18 11:23:58 -0700 | [diff] [blame] | 432 | #if __BSD_VISIBLE |
Josh Gao | 14adff1 | 2016-04-29 12:00:55 -0700 | [diff] [blame] | 433 | long double lgammal_r(long double, int*) __INTRODUCED_IN(23); |
Elliott Hughes | 7553185 | 2014-09-18 11:23:58 -0700 | [diff] [blame] | 434 | #endif |
| 435 | |
Elliott Hughes | 5f5cc45 | 2014-08-18 16:04:03 -0700 | [diff] [blame] | 436 | #if defined(__USE_GNU) |
Elliott Hughes | b4f2f28 | 2014-05-08 21:19:12 -0700 | [diff] [blame] | 437 | void sincos(double, double*, double*); |
| 438 | void sincosf(float, float*, float*); |
| 439 | void sincosl(long double, long double*, long double*); |
Elliott Hughes | 5f5cc45 | 2014-08-18 16:04:03 -0700 | [diff] [blame] | 440 | #endif /* __USE_GNU */ |
Elliott Hughes | b4f2f28 | 2014-05-08 21:19:12 -0700 | [diff] [blame] | 441 | |
Elliott Hughes | de9ac71 | 2014-05-19 16:58:52 -0700 | [diff] [blame] | 442 | #pragma GCC visibility pop |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 443 | __END_DECLS |
| 444 | |
| 445 | #endif /* !_MATH_H_ */ |