Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <float.h> |
| 18 | #include <math.h> |
| 19 | |
| 20 | extern int __isinf(double); /* isinf.c */ |
| 21 | int (isinf)(double a1) { return __isinf(a1); } |
| 22 | |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 23 | int (isnanf)(float a1) { return __isnanf(a1); } |
| 24 | |
Calin Juravle | 4d77c11 | 2014-03-14 17:56:46 +0000 | [diff] [blame^] | 25 | // FreeBSD falls back to the double variants of these functions as well. |
| 26 | long double coshl(long double a1) { return cosh(a1); } |
| 27 | long double erfcl(long double a1) { return erfc(a1); } |
| 28 | long double erfl(long double a1) { return erf(a1); } |
| 29 | long double lgammal(long double a1) { return lgamma(a1); } |
| 30 | long double powl(long double a1, long double a2) { return pow(a1, a2); } |
| 31 | long double sinhl(long double a1) { return sinh(a1); } |
| 32 | long double tanhl(long double a1) { return tanh(a1); } |
| 33 | long double tgammal(long double a1) { return tgamma(a1); } |
| 34 | long double significandl(long double a1) { return significand(a1); } |
| 35 | |
| 36 | #ifndef __LP64__ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 37 | /* |
| 38 | * The BSD "long double" functions are broken when sizeof(long double) == sizeof(double). |
| 39 | * Android works around those cases by replacing the broken functions with our own trivial stubs |
| 40 | * that call the regular "double" function. |
| 41 | */ |
| 42 | |
| 43 | int __fpclassifyl(long double a1) { return __fpclassifyd(a1); } |
| 44 | int __isfinitel(long double a1) { return __isfinite(a1); } |
| 45 | int __isinfl(long double a1) { return __isinf(a1); } |
Elliott Hughes | 28ddd91 | 2013-12-19 17:13:56 -0800 | [diff] [blame] | 46 | int __isnanl(long double a1) { return (isnan)(a1); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 47 | int __isnormall(long double a1) { return __isnormal(a1); } |
| 48 | int __signbitl(long double a1) { return __signbit(a1); } |
| 49 | |
| 50 | long double acoshl(long double a1) { return acosh(a1); } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 51 | long double acosl(long double a1) { return acos(a1); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 52 | long double asinhl(long double a1) { return asinh(a1); } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 53 | long double asinl(long double a1) { return asin(a1); } |
| 54 | long double atan2l(long double a1, long double a2) { return atan2(a1, a2); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 55 | long double atanhl(long double a1) { return atanh(a1); } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 56 | long double atanl(long double a1) { return atan(a1); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 57 | long double cbrtl(long double a1) { return cbrt(a1); } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 58 | long double ceill(long double a1) { return ceil(a1); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 59 | long double copysignl(long double a1, long double a2) { return copysign(a1, a2); } |
Calin Juravle | 4d77c11 | 2014-03-14 17:56:46 +0000 | [diff] [blame^] | 60 | |
Elliott Hughes | 170dbe2 | 2013-02-07 17:45:11 -0800 | [diff] [blame] | 61 | long double cosl(long double a1) { return cos(a1); } |
Calin Juravle | 4d77c11 | 2014-03-14 17:56:46 +0000 | [diff] [blame^] | 62 | |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 63 | long double exp2l(long double a1) { return exp2(a1); } |
| 64 | long double expl(long double a1) { return exp(a1); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 65 | long double expm1l(long double a1) { return expm1(a1); } |
| 66 | long double fabsl(long double a1) { return fabs(a1); } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 67 | long double floorl(long double a1) { return floor(a1); } |
| 68 | long double fmal(long double a1, long double a2, long double a3) { return fma(a1, a2, a3); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 69 | long double fmaxl(long double a1, long double a2) { return fmax(a1, a2); } |
| 70 | long double fmodl(long double a1, long double a2) { return fmod(a1, a2); } |
| 71 | long double fminl(long double a1, long double a2) { return fmin(a1, a2); } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 72 | long double frexpl(long double a1, int* a2) { return frexp(a1, a2); } |
| 73 | long double hypotl(long double a1, long double a2) { return hypot(a1, a2); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 74 | int ilogbl(long double a1) { return ilogb(a1); } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 75 | long double ldexpl(long double a1, int a2) { return ldexp(a1, a2); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 76 | long long llrintl(long double a1) { return llrint(a1); } |
| 77 | long double log10l(long double a1) { return log10(a1); } |
| 78 | long double log1pl(long double a1) { return log1p(a1); } |
| 79 | long double log2l(long double a1) { return log2(a1); } |
Elliott Hughes | 926a307 | 2013-02-06 16:07:54 -0800 | [diff] [blame] | 80 | long double logbl(long double a1) { return logb(a1); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 81 | long double logl(long double a1) { return log(a1); } |
| 82 | long lrintl(long double a1) { return lrint(a1); } |
| 83 | long long llroundl(long double a1) { return llround(a1); } |
| 84 | long lroundl(long double a1) { return lround(a1); } |
Calin Juravle | 4d77c11 | 2014-03-14 17:56:46 +0000 | [diff] [blame^] | 85 | long double modfl(long double a1, long double* a2) { double i; double f = modf(a1, &i); *a2 = i; return f; } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 86 | long double nanl(const char* a1) { return nan(a1); } |
| 87 | long double nextafterl(long double a1, long double a2) { return nextafter(a1, a2); } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 88 | long double remainderl(long double a1, long double a2) { return remainder(a1, a2); } |
| 89 | long double remquol(long double a1, long double a2, int* a3) { return remquo(a1, a2, a3); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 90 | long double rintl(long double a1) { return rint(a1); } |
| 91 | long double roundl(long double a1) { return round(a1); } |
| 92 | long double scalbnl(long double a1, int a2) { return scalbn(a1, a2); } |
Elliott Hughes | 170dbe2 | 2013-02-07 17:45:11 -0800 | [diff] [blame] | 93 | long double sinl(long double a1) { return sin(a1); } |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 94 | long double sqrtl(long double a1) { return sqrt(a1); } |
Elliott Hughes | 170dbe2 | 2013-02-07 17:45:11 -0800 | [diff] [blame] | 95 | long double tanl(long double a1) { return tan(a1); } |
Elliott Hughes | 241608e | 2013-12-18 16:06:52 -0800 | [diff] [blame] | 96 | long double truncl(long double a1) { return trunc(a1); } |
Calin Juravle | 4d77c11 | 2014-03-14 17:56:46 +0000 | [diff] [blame^] | 97 | |
| 98 | #endif // __LP64__ |