1#pragma once 2 3// __clang_cuda_(c)math(.h) also provide `abs` which actually belong in 4// cstdlib. We could split them out but for now we just include cstdlib from 5// cmath.h which is what the systems I've seen do as well. 6#include <cstdlib> 7 8#include <math.h> 9 10double acos(double); 11float acos(float); 12double acosh(double); 13float acosh(float); 14double asin(double); 15float asin(float); 16double asinh(double); 17float asinh(float); 18double atan2(double, double); 19float atan2(float, float); 20double atan(double); 21float atan(float); 22double atanh(double); 23float atanh(float); 24double cbrt(double); 25float cbrt(float); 26double ceil(double); 27float ceil(float); 28double copysign(double, double); 29float copysign(float, float); 30double cos(double); 31float cos(float); 32double cosh(double); 33float cosh(float); 34double erfc(double); 35float erfc(float); 36double erf(double); 37float erf(float); 38double exp2(double); 39float exp2(float); 40double exp(double); 41float exp(float); 42double expm1(double); 43float expm1(float); 44double fdim(double, double); 45float fdim(float, float); 46double floor(double); 47float floor(float); 48double fma(double, double, double); 49float fma(float, float, float); 50double fmax(double, double); 51float fmax(float, float); 52float max(float, float); 53double max(double, double); 54double fmin(double, double); 55float fmin(float, float); 56float min(float, float); 57double min(double, double); 58double fmod(double, double); 59float fmod(float, float); 60int fpclassify(double); 61int fpclassify(float); 62double frexp(double, int *); 63float frexp(float, int *); 64double hypot(double, double); 65float hypot(float, float); 66int ilogb(double); 67int ilogb(float); 68bool isfinite(long double); 69bool isfinite(double); 70bool isfinite(float); 71bool isgreater(double, double); 72bool isgreaterequal(double, double); 73bool isgreaterequal(float, float); 74bool isgreater(float, float); 75bool isinf(long double); 76bool isinf(double); 77bool isinf(float); 78bool isless(double, double); 79bool islessequal(double, double); 80bool islessequal(float, float); 81bool isless(float, float); 82bool islessgreater(double, double); 83bool islessgreater(float, float); 84bool isnan(long double); 85#ifdef USE_ISNAN_WITH_INT_RETURN 86int isnan(double); 87int isnan(float); 88#else 89bool isnan(double); 90bool isnan(float); 91#endif 92bool isnormal(double); 93bool isnormal(float); 94bool isunordered(double, double); 95bool isunordered(float, float); 96double ldexp(double, int); 97float ldexp(float, int); 98double lgamma(double); 99float lgamma(float); 100long long llrint(double); 101long long llrint(float); 102double log10(double); 103float log10(float); 104double log1p(double); 105float log1p(float); 106double log2(double); 107float log2(float); 108double logb(double); 109float logb(float); 110double log(double); 111float log(float); 112long lrint(double); 113long lrint(float); 114long lround(double); 115long lround(float); 116long long llround(float); // No llround(double). 117double modf(double, double *); 118float modf(float, float *); 119double nan(const char *); 120float nanf(const char *); 121double nearbyint(double); 122float nearbyint(float); 123double nextafter(double, double); 124float nextafter(float, float); 125double pow(double, double); 126double pow(double, int); 127float pow(float, float); 128float pow(float, int); 129double remainder(double, double); 130float remainder(float, float); 131double remquo(double, double, int *); 132float remquo(float, float, int *); 133double rint(double); 134float rint(float); 135double round(double); 136float round(float); 137double scalbln(double, long); 138float scalbln(float, long); 139double scalbn(double, int); 140float scalbn(float, int); 141bool signbit(double); 142bool signbit(float); 143long double sin(long double); 144double sin(double); 145float sin(float); 146double sinh(double); 147float sinh(float); 148double sqrt(double); 149float sqrt(float); 150double tan(double); 151float tan(float); 152double tanh(double); 153float tanh(float); 154double tgamma(double); 155float tgamma(float); 156double trunc(double); 157float trunc(float); 158 159namespace std { 160 161using ::acos; 162using ::acosh; 163using ::asin; 164using ::asinh; 165using ::atan; 166using ::atan2; 167using ::atanh; 168using ::cbrt; 169using ::ceil; 170using ::copysign; 171using ::cos; 172using ::cosh; 173using ::erf; 174using ::erfc; 175using ::exp; 176using ::exp2; 177using ::expm1; 178using ::fdim; 179using ::floor; 180using ::fma; 181using ::fmax; 182using ::fmin; 183using ::fmod; 184using ::fpclassify; 185using ::frexp; 186using ::hypot; 187using ::ilogb; 188using ::isfinite; 189using ::isgreater; 190using ::isgreaterequal; 191using ::isinf; 192using ::isless; 193using ::islessequal; 194using ::islessgreater; 195using ::isnan; 196using ::isnormal; 197using ::isunordered; 198using ::ldexp; 199using ::lgamma; 200using ::llrint; 201using ::log; 202using ::log10; 203using ::log1p; 204using ::log2; 205using ::logb; 206using ::lrint; 207using ::lround; 208using ::llround; 209using ::modf; 210using ::nan; 211using ::nanf; 212using ::nearbyint; 213using ::nextafter; 214using ::pow; 215using ::remainder; 216using ::remquo; 217using ::rint; 218using ::round; 219using ::scalbln; 220using ::scalbn; 221using ::signbit; 222using ::sin; 223using ::sinh; 224using ::sqrt; 225using ::tan; 226using ::tanh; 227using ::tgamma; 228using ::trunc; 229 230} // namespace std 231 232#define FP_NAN 0 233#define FP_INFINITE 1 234#define FP_ZERO 2 235#define FP_SUBNORMAL 3 236#define FP_NORMAL 4 237