15 */ 16 17#ifndef _MATH_H_ 18#define _MATH_H_ 19 20#include <sys/cdefs.h> 21#include <sys/_types.h> 22#include <machine/_limits.h> 23 24/* 25 * ANSI/POSIX 26 */ 27extern const union __infinity_un { 28 unsigned char __uc[8]; 29 double __ud; 30} __infinity; 31 32extern const union __nan_un { 33 unsigned char __uc[sizeof(float)]; 34 float __uf; 35} __nan; 36 37#if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) 38#define __MATH_BUILTIN_CONSTANTS 39#endif 40 41#if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER) 42#define __MATH_BUILTIN_RELOPS 43#endif 44 45#ifdef __MATH_BUILTIN_CONSTANTS 46#define HUGE_VAL __builtin_huge_val() 47#else 48#define HUGE_VAL (__infinity.__ud) 49#endif 50 51#if __ISO_C_VISIBLE >= 1999 52#define FP_ILOGB0 (-__INT_MAX) 53#define FP_ILOGBNAN __INT_MAX 54 55#ifdef __MATH_BUILTIN_CONSTANTS 56#define HUGE_VALF __builtin_huge_valf() 57#define HUGE_VALL __builtin_huge_vall() 58#define INFINITY __builtin_inf() 59#define NAN __builtin_nan("") 60#else 61#define HUGE_VALF (float)HUGE_VAL 62#define HUGE_VALL (long double)HUGE_VAL 63#define INFINITY HUGE_VALF 64#define NAN (__nan.__uf) 65#endif /* __MATH_BUILTIN_CONSTANTS */ 66 67#define MATH_ERRNO 1 68#define MATH_ERREXCEPT 2 69#define math_errhandling 0 70 71/* Symbolic constants to classify floating point numbers. */ 72#define FP_INFINITE 0x01 73#define FP_NAN 0x02 74#define FP_NORMAL 0x04 75#define FP_SUBNORMAL 0x08 76#define FP_ZERO 0x10 77#define fpclassify(x) \ 78 ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \ 79 : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \ 80 : __fpclassifyl(x)) 81 82#define isfinite(x) \ 83 ((sizeof (x) == sizeof (float)) ? __isfinitef(x) \ 84 : (sizeof (x) == sizeof (double)) ? __isfinite(x) \ 85 : __isfinitel(x)) 86#define isinf(x) \ 87 ((sizeof (x) == sizeof (float)) ? __isinff(x) \ 88 : (sizeof (x) == sizeof (double)) ? isinf(x) \ 89 : __isinfl(x)) 90#define isnan(x) \ 91 ((sizeof (x) == sizeof (float)) ? isnanf(x) \ 92 : (sizeof (x) == sizeof (double)) ? isnan(x) \ 93 : __isnanl(x)) 94#define isnormal(x) \ 95 ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \ 96 : (sizeof (x) == sizeof (double)) ? __isnormal(x) \ 97 : __isnormall(x)) 98 99#ifdef __MATH_BUILTIN_RELOPS 100#define isgreater(x, y) __builtin_isgreater((x), (y)) 101#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) 102#define isless(x, y) __builtin_isless((x), (y)) 103#define islessequal(x, y) __builtin_islessequal((x), (y)) 104#define islessgreater(x, y) __builtin_islessgreater((x), (y)) 105#define isunordered(x, y) __builtin_isunordered((x), (y)) 106#else 107#define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y)) 108#define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y)) 109#define isless(x, y) (!isunordered((x), (y)) && (x) < (y)) 110#define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y)) 111#define islessgreater(x, y) (!isunordered((x), (y)) && \ 112 ((x) > (y) || (y) > (x))) 113#define isunordered(x, y) (isnan(x) || isnan(y)) 114#endif /* __MATH_BUILTIN_RELOPS */ 115 116#define signbit(x) \ 117 ((sizeof (x) == sizeof (float)) ? __signbitf(x) \ 118 : (sizeof (x) == sizeof (double)) ? __signbit(x) \ 119 : __signbitl(x)) 120 121typedef __double_t double_t; 122typedef __float_t float_t; 123#endif /* __ISO_C_VISIBLE >= 1999 */ 124 125/* 126 * XOPEN/SVID 127 */ 128#if __BSD_VISIBLE || __XSI_VISIBLE 129#define M_E 2.7182818284590452354 /* e */ 130#define M_LOG2E 1.4426950408889634074 /* log 2e */ 131#define M_LOG10E 0.43429448190325182765 /* log 10e */ 132#define M_LN2 0.69314718055994530942 /* log e2 */ 133#define M_LN10 2.30258509299404568402 /* log e10 */ 134#define M_PI 3.14159265358979323846 /* pi */ 135#define M_PI_2 1.57079632679489661923 /* pi/2 */ 136#define M_PI_4 0.78539816339744830962 /* pi/4 */ 137#define M_1_PI 0.31830988618379067154 /* 1/pi */ 138#define M_2_PI 0.63661977236758134308 /* 2/pi */ 139#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ 140#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ 141#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ 142 143#define MAXFLOAT ((float)3.40282346638528860e+38) 144extern int signgam; 145#endif /* __BSD_VISIBLE || __XSI_VISIBLE */ 146 147#if __BSD_VISIBLE 148enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix}; 149 150#define _LIB_VERSION_TYPE enum fdversion 151#define _LIB_VERSION _fdlib_version 152 153/* if global variable _LIB_VERSION is not desirable, one may 154 * change the following to be a constant by: 155 * #define _LIB_VERSION_TYPE const enum version 156 * In that case, after one initializes the value _LIB_VERSION (see 157 * s_lib_version.c) during compile time, it cannot be modified 158 * in the middle of a program 159 */ 160extern _LIB_VERSION_TYPE _LIB_VERSION; 161 162#define _IEEE_ fdlibm_ieee 163#define _SVID_ fdlibm_svid 164#define _XOPEN_ fdlibm_xopen 165#define _POSIX_ fdlibm_posix 166 167/* We have a problem when using C++ since `exception' is a reserved 168 name in C++. */ 169#ifndef __cplusplus 170struct exception { 171 int type; 172 char *name; 173 double arg1; 174 double arg2; 175 double retval; 176}; 177#endif 178 179#if 0 180/* Old value from 4.4BSD-Lite math.h; this is probably better. */ 181#define HUGE HUGE_VAL 182#else 183#define HUGE MAXFLOAT 184#endif 185 186#define X_TLOSS 1.41484755040568800000e+16 /* pi*2**52 */ 187 188#define DOMAIN 1 189#define SING 2 190#define OVERFLOW 3 191#define UNDERFLOW 4 192#define TLOSS 5 193#define PLOSS 6 194 195#endif /* __BSD_VISIBLE */ 196 197/* 198 * Most of these functions have the side effect of setting errno, so they 199 * are not declared as __pure2. (XXX: this point needs to be revisited, 200 * since C99 doesn't require the mistake of setting errno, and we mostly 201 * don't set it anyway. In C99, pragmas and functions for changing the 202 * rounding mode affect the purity of these functions.) 203 */ 204__BEGIN_DECLS 205/* 206 * ANSI/POSIX 207 */ 208int __fpclassifyd(double) __pure2; 209int __fpclassifyf(float) __pure2; 210int __fpclassifyl(long double) __pure2; 211int __isfinitef(float) __pure2; 212int __isfinite(double) __pure2; 213int __isfinitel(long double) __pure2; 214int __isinff(float) __pure2; 215int __isinfl(long double) __pure2; 216int __isnanl(long double) __pure2; 217int __isnormalf(float) __pure2; 218int __isnormal(double) __pure2; 219int __isnormall(long double) __pure2; 220int __signbit(double) __pure2; 221int __signbitf(float) __pure2; 222int __signbitl(long double) __pure2; 223 224double acos(double); 225double asin(double); 226double atan(double); 227double atan2(double, double); 228double cos(double); 229double sin(double); 230double tan(double); 231 232double cosh(double); 233double sinh(double); 234double tanh(double); 235 236double exp(double); 237double frexp(double, int *); /* fundamentally !__pure2 */ 238double ldexp(double, int); 239double log(double); 240double log10(double); 241double modf(double, double *); /* fundamentally !__pure2 */ 242 243double pow(double, double); 244double sqrt(double); 245 246double ceil(double); 247double fabs(double); 248double floor(double); 249double fmod(double, double); 250 251/* 252 * These functions are not in C90 so they can be "right". The ones that 253 * never set errno in lib/msun are declared as __pure2. 254 */ 255#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE 256double acosh(double); 257double asinh(double); 258double atanh(double); 259double cbrt(double) __pure2; 260double erf(double); 261double erfc(double) __pure2; 262double expm1(double) __pure2; 263double hypot(double, double); 264int ilogb(double); 265int (isinf)(double) __pure2; 266int (isnan)(double) __pure2; 267double lgamma(double); 268long long llrint(double); 269long long llround(double); 270double log1p(double) __pure2; 271double logb(double) __pure2; 272long lrint(double); 273long lround(double); 274double nextafter(double, double); 275double remainder(double, double); 276double rint(double) __pure2; 277#endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */ 278 279#if __BSD_VISIBLE || __XSI_VISIBLE 280double j0(double); 281double j1(double); 282double jn(int, double); 283double scalb(double, double); 284double y0(double); 285double y1(double); 286double yn(int, double); 287 288#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE 289double gamma(double); 290#endif 291#endif /* __BSD_VISIBLE || __XSI_VISIBLE */ 292 293#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 294double copysign(double, double) __pure2; 295double fdim(double, double); 296double fmax(double, double) __pure2; 297double fmin(double, double) __pure2; 298double nearbyint(double) __pure2; 299double round(double); 300double scalbln(double, long); 301double scalbn(double, int); 302double tgamma(double); 303double trunc(double); 304#endif 305 306/* 307 * BSD math library entry points 308 */ 309#if __BSD_VISIBLE 310double drem(double, double); 311int finite(double) __pure2; 312int isnanf(float) __pure2; 313 314/* 315 * Reentrant version of gamma & lgamma; passes signgam back by reference 316 * as the second argument; user must allocate space for signgam. 317 */ 318double gamma_r(double, int *); 319double lgamma_r(double, int *); 320 321/* 322 * IEEE Test Vector 323 */ 324double significand(double); 325 326#ifndef __cplusplus 327int matherr(struct exception *); 328#endif 329#endif /* __BSD_VISIBLE */ 330 331/* float versions of ANSI/POSIX functions */ 332#if __ISO_C_VISIBLE >= 1999 333float acosf(float); 334float asinf(float); 335float atanf(float); 336float atan2f(float, float); 337float cosf(float); 338float sinf(float); 339float tanf(float); 340 341float coshf(float); 342float sinhf(float); 343float tanhf(float); 344 345float expf(float); 346float expm1f(float) __pure2; 347float frexpf(float, int *); /* fundamentally !__pure2 */ 348int ilogbf(float); 349float ldexpf(float, int); 350float log10f(float); 351float log1pf(float) __pure2; 352float logf(float); 353float modff(float, float *); /* fundamentally !__pure2 */ 354 355float powf(float, float); 356float sqrtf(float); 357 358float ceilf(float); 359float fabsf(float); 360float floorf(float); 361float fmodf(float, float); 362float roundf(float); 363 364float erff(float); 365float erfcf(float) __pure2; 366float hypotf(float, float) __pure2; 367float lgammaf(float); 368 369float acoshf(float); 370float asinhf(float); 371float atanhf(float); 372float cbrtf(float) __pure2; 373float logbf(float) __pure2; 374float copysignf(float, float) __pure2; 375long long llrintf(float); 376long long llroundf(float); 377long lrintf(float); 378long lroundf(float); 379float nearbyintf(float) __pure2; 380float nextafterf(float, float); 381float remainderf(float, float); 382float rintf(float); 383float scalblnf(float, long); 384float scalbnf(float, int); 385float truncf(float); 386 387float fdimf(float, float); 388float fmaxf(float, float) __pure2; 389float fminf(float, float) __pure2; 390#endif 391 392/* 393 * float versions of BSD math library entry points 394 */ 395#if __BSD_VISIBLE 396float dremf(float, float); 397int finitef(float) __pure2; 398float gammaf(float); 399float j0f(float); 400float j1f(float); 401float jnf(int, float); 402float scalbf(float, float); 403float y0f(float); 404float y1f(float); 405float ynf(int, float); 406 407/* 408 * Float versions of reentrant version of gamma & lgamma; passes 409 * signgam back by reference as the second argument; user must 410 * allocate space for signgam. 411 */ 412float gammaf_r(float, int *); 413float lgammaf_r(float, int *); 414 415/* 416 * float version of IEEE Test Vector 417 */ 418float significandf(float); 419#endif /* __BSD_VISIBLE */ 420 421/* 422 * long double versions of ISO/POSIX math functions 423 */ 424#if __ISO_C_VISIBLE >= 1999 425#if 0 426long double acoshl(long double); 427long double acosl(long double); 428long double asinhl(long double); 429long double asinl(long double); 430long double atan2l(long double, long double); 431long double atanhl(long double); 432long double atanl(long double); 433long double cbrtl(long double);
| 15 */ 16 17#ifndef _MATH_H_ 18#define _MATH_H_ 19 20#include <sys/cdefs.h> 21#include <sys/_types.h> 22#include <machine/_limits.h> 23 24/* 25 * ANSI/POSIX 26 */ 27extern const union __infinity_un { 28 unsigned char __uc[8]; 29 double __ud; 30} __infinity; 31 32extern const union __nan_un { 33 unsigned char __uc[sizeof(float)]; 34 float __uf; 35} __nan; 36 37#if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) 38#define __MATH_BUILTIN_CONSTANTS 39#endif 40 41#if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER) 42#define __MATH_BUILTIN_RELOPS 43#endif 44 45#ifdef __MATH_BUILTIN_CONSTANTS 46#define HUGE_VAL __builtin_huge_val() 47#else 48#define HUGE_VAL (__infinity.__ud) 49#endif 50 51#if __ISO_C_VISIBLE >= 1999 52#define FP_ILOGB0 (-__INT_MAX) 53#define FP_ILOGBNAN __INT_MAX 54 55#ifdef __MATH_BUILTIN_CONSTANTS 56#define HUGE_VALF __builtin_huge_valf() 57#define HUGE_VALL __builtin_huge_vall() 58#define INFINITY __builtin_inf() 59#define NAN __builtin_nan("") 60#else 61#define HUGE_VALF (float)HUGE_VAL 62#define HUGE_VALL (long double)HUGE_VAL 63#define INFINITY HUGE_VALF 64#define NAN (__nan.__uf) 65#endif /* __MATH_BUILTIN_CONSTANTS */ 66 67#define MATH_ERRNO 1 68#define MATH_ERREXCEPT 2 69#define math_errhandling 0 70 71/* Symbolic constants to classify floating point numbers. */ 72#define FP_INFINITE 0x01 73#define FP_NAN 0x02 74#define FP_NORMAL 0x04 75#define FP_SUBNORMAL 0x08 76#define FP_ZERO 0x10 77#define fpclassify(x) \ 78 ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \ 79 : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \ 80 : __fpclassifyl(x)) 81 82#define isfinite(x) \ 83 ((sizeof (x) == sizeof (float)) ? __isfinitef(x) \ 84 : (sizeof (x) == sizeof (double)) ? __isfinite(x) \ 85 : __isfinitel(x)) 86#define isinf(x) \ 87 ((sizeof (x) == sizeof (float)) ? __isinff(x) \ 88 : (sizeof (x) == sizeof (double)) ? isinf(x) \ 89 : __isinfl(x)) 90#define isnan(x) \ 91 ((sizeof (x) == sizeof (float)) ? isnanf(x) \ 92 : (sizeof (x) == sizeof (double)) ? isnan(x) \ 93 : __isnanl(x)) 94#define isnormal(x) \ 95 ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \ 96 : (sizeof (x) == sizeof (double)) ? __isnormal(x) \ 97 : __isnormall(x)) 98 99#ifdef __MATH_BUILTIN_RELOPS 100#define isgreater(x, y) __builtin_isgreater((x), (y)) 101#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) 102#define isless(x, y) __builtin_isless((x), (y)) 103#define islessequal(x, y) __builtin_islessequal((x), (y)) 104#define islessgreater(x, y) __builtin_islessgreater((x), (y)) 105#define isunordered(x, y) __builtin_isunordered((x), (y)) 106#else 107#define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y)) 108#define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y)) 109#define isless(x, y) (!isunordered((x), (y)) && (x) < (y)) 110#define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y)) 111#define islessgreater(x, y) (!isunordered((x), (y)) && \ 112 ((x) > (y) || (y) > (x))) 113#define isunordered(x, y) (isnan(x) || isnan(y)) 114#endif /* __MATH_BUILTIN_RELOPS */ 115 116#define signbit(x) \ 117 ((sizeof (x) == sizeof (float)) ? __signbitf(x) \ 118 : (sizeof (x) == sizeof (double)) ? __signbit(x) \ 119 : __signbitl(x)) 120 121typedef __double_t double_t; 122typedef __float_t float_t; 123#endif /* __ISO_C_VISIBLE >= 1999 */ 124 125/* 126 * XOPEN/SVID 127 */ 128#if __BSD_VISIBLE || __XSI_VISIBLE 129#define M_E 2.7182818284590452354 /* e */ 130#define M_LOG2E 1.4426950408889634074 /* log 2e */ 131#define M_LOG10E 0.43429448190325182765 /* log 10e */ 132#define M_LN2 0.69314718055994530942 /* log e2 */ 133#define M_LN10 2.30258509299404568402 /* log e10 */ 134#define M_PI 3.14159265358979323846 /* pi */ 135#define M_PI_2 1.57079632679489661923 /* pi/2 */ 136#define M_PI_4 0.78539816339744830962 /* pi/4 */ 137#define M_1_PI 0.31830988618379067154 /* 1/pi */ 138#define M_2_PI 0.63661977236758134308 /* 2/pi */ 139#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ 140#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ 141#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ 142 143#define MAXFLOAT ((float)3.40282346638528860e+38) 144extern int signgam; 145#endif /* __BSD_VISIBLE || __XSI_VISIBLE */ 146 147#if __BSD_VISIBLE 148enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix}; 149 150#define _LIB_VERSION_TYPE enum fdversion 151#define _LIB_VERSION _fdlib_version 152 153/* if global variable _LIB_VERSION is not desirable, one may 154 * change the following to be a constant by: 155 * #define _LIB_VERSION_TYPE const enum version 156 * In that case, after one initializes the value _LIB_VERSION (see 157 * s_lib_version.c) during compile time, it cannot be modified 158 * in the middle of a program 159 */ 160extern _LIB_VERSION_TYPE _LIB_VERSION; 161 162#define _IEEE_ fdlibm_ieee 163#define _SVID_ fdlibm_svid 164#define _XOPEN_ fdlibm_xopen 165#define _POSIX_ fdlibm_posix 166 167/* We have a problem when using C++ since `exception' is a reserved 168 name in C++. */ 169#ifndef __cplusplus 170struct exception { 171 int type; 172 char *name; 173 double arg1; 174 double arg2; 175 double retval; 176}; 177#endif 178 179#if 0 180/* Old value from 4.4BSD-Lite math.h; this is probably better. */ 181#define HUGE HUGE_VAL 182#else 183#define HUGE MAXFLOAT 184#endif 185 186#define X_TLOSS 1.41484755040568800000e+16 /* pi*2**52 */ 187 188#define DOMAIN 1 189#define SING 2 190#define OVERFLOW 3 191#define UNDERFLOW 4 192#define TLOSS 5 193#define PLOSS 6 194 195#endif /* __BSD_VISIBLE */ 196 197/* 198 * Most of these functions have the side effect of setting errno, so they 199 * are not declared as __pure2. (XXX: this point needs to be revisited, 200 * since C99 doesn't require the mistake of setting errno, and we mostly 201 * don't set it anyway. In C99, pragmas and functions for changing the 202 * rounding mode affect the purity of these functions.) 203 */ 204__BEGIN_DECLS 205/* 206 * ANSI/POSIX 207 */ 208int __fpclassifyd(double) __pure2; 209int __fpclassifyf(float) __pure2; 210int __fpclassifyl(long double) __pure2; 211int __isfinitef(float) __pure2; 212int __isfinite(double) __pure2; 213int __isfinitel(long double) __pure2; 214int __isinff(float) __pure2; 215int __isinfl(long double) __pure2; 216int __isnanl(long double) __pure2; 217int __isnormalf(float) __pure2; 218int __isnormal(double) __pure2; 219int __isnormall(long double) __pure2; 220int __signbit(double) __pure2; 221int __signbitf(float) __pure2; 222int __signbitl(long double) __pure2; 223 224double acos(double); 225double asin(double); 226double atan(double); 227double atan2(double, double); 228double cos(double); 229double sin(double); 230double tan(double); 231 232double cosh(double); 233double sinh(double); 234double tanh(double); 235 236double exp(double); 237double frexp(double, int *); /* fundamentally !__pure2 */ 238double ldexp(double, int); 239double log(double); 240double log10(double); 241double modf(double, double *); /* fundamentally !__pure2 */ 242 243double pow(double, double); 244double sqrt(double); 245 246double ceil(double); 247double fabs(double); 248double floor(double); 249double fmod(double, double); 250 251/* 252 * These functions are not in C90 so they can be "right". The ones that 253 * never set errno in lib/msun are declared as __pure2. 254 */ 255#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE 256double acosh(double); 257double asinh(double); 258double atanh(double); 259double cbrt(double) __pure2; 260double erf(double); 261double erfc(double) __pure2; 262double expm1(double) __pure2; 263double hypot(double, double); 264int ilogb(double); 265int (isinf)(double) __pure2; 266int (isnan)(double) __pure2; 267double lgamma(double); 268long long llrint(double); 269long long llround(double); 270double log1p(double) __pure2; 271double logb(double) __pure2; 272long lrint(double); 273long lround(double); 274double nextafter(double, double); 275double remainder(double, double); 276double rint(double) __pure2; 277#endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */ 278 279#if __BSD_VISIBLE || __XSI_VISIBLE 280double j0(double); 281double j1(double); 282double jn(int, double); 283double scalb(double, double); 284double y0(double); 285double y1(double); 286double yn(int, double); 287 288#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE 289double gamma(double); 290#endif 291#endif /* __BSD_VISIBLE || __XSI_VISIBLE */ 292 293#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 294double copysign(double, double) __pure2; 295double fdim(double, double); 296double fmax(double, double) __pure2; 297double fmin(double, double) __pure2; 298double nearbyint(double) __pure2; 299double round(double); 300double scalbln(double, long); 301double scalbn(double, int); 302double tgamma(double); 303double trunc(double); 304#endif 305 306/* 307 * BSD math library entry points 308 */ 309#if __BSD_VISIBLE 310double drem(double, double); 311int finite(double) __pure2; 312int isnanf(float) __pure2; 313 314/* 315 * Reentrant version of gamma & lgamma; passes signgam back by reference 316 * as the second argument; user must allocate space for signgam. 317 */ 318double gamma_r(double, int *); 319double lgamma_r(double, int *); 320 321/* 322 * IEEE Test Vector 323 */ 324double significand(double); 325 326#ifndef __cplusplus 327int matherr(struct exception *); 328#endif 329#endif /* __BSD_VISIBLE */ 330 331/* float versions of ANSI/POSIX functions */ 332#if __ISO_C_VISIBLE >= 1999 333float acosf(float); 334float asinf(float); 335float atanf(float); 336float atan2f(float, float); 337float cosf(float); 338float sinf(float); 339float tanf(float); 340 341float coshf(float); 342float sinhf(float); 343float tanhf(float); 344 345float expf(float); 346float expm1f(float) __pure2; 347float frexpf(float, int *); /* fundamentally !__pure2 */ 348int ilogbf(float); 349float ldexpf(float, int); 350float log10f(float); 351float log1pf(float) __pure2; 352float logf(float); 353float modff(float, float *); /* fundamentally !__pure2 */ 354 355float powf(float, float); 356float sqrtf(float); 357 358float ceilf(float); 359float fabsf(float); 360float floorf(float); 361float fmodf(float, float); 362float roundf(float); 363 364float erff(float); 365float erfcf(float) __pure2; 366float hypotf(float, float) __pure2; 367float lgammaf(float); 368 369float acoshf(float); 370float asinhf(float); 371float atanhf(float); 372float cbrtf(float) __pure2; 373float logbf(float) __pure2; 374float copysignf(float, float) __pure2; 375long long llrintf(float); 376long long llroundf(float); 377long lrintf(float); 378long lroundf(float); 379float nearbyintf(float) __pure2; 380float nextafterf(float, float); 381float remainderf(float, float); 382float rintf(float); 383float scalblnf(float, long); 384float scalbnf(float, int); 385float truncf(float); 386 387float fdimf(float, float); 388float fmaxf(float, float) __pure2; 389float fminf(float, float) __pure2; 390#endif 391 392/* 393 * float versions of BSD math library entry points 394 */ 395#if __BSD_VISIBLE 396float dremf(float, float); 397int finitef(float) __pure2; 398float gammaf(float); 399float j0f(float); 400float j1f(float); 401float jnf(int, float); 402float scalbf(float, float); 403float y0f(float); 404float y1f(float); 405float ynf(int, float); 406 407/* 408 * Float versions of reentrant version of gamma & lgamma; passes 409 * signgam back by reference as the second argument; user must 410 * allocate space for signgam. 411 */ 412float gammaf_r(float, int *); 413float lgammaf_r(float, int *); 414 415/* 416 * float version of IEEE Test Vector 417 */ 418float significandf(float); 419#endif /* __BSD_VISIBLE */ 420 421/* 422 * long double versions of ISO/POSIX math functions 423 */ 424#if __ISO_C_VISIBLE >= 1999 425#if 0 426long double acoshl(long double); 427long double acosl(long double); 428long double asinhl(long double); 429long double asinl(long double); 430long double atan2l(long double, long double); 431long double atanhl(long double); 432long double atanl(long double); 433long double cbrtl(long double);
|
436long double copysignl(long double, long double); 437#if 0 438long double coshl(long double); 439long double cosl(long double); 440long double erfcl(long double); 441long double erfl(long double); 442long double exp2l(long double); 443long double expl(long double); 444long double expm1l(long double); 445#endif 446long double fabsl(long double); 447long double fdiml(long double, long double); 448long double floorl(long double); 449#if 0 450long double fmal(long double, long double, long double); 451#endif 452long double fmaxl(long double, long double) __pure2; 453long double fminl(long double, long double) __pure2; 454#if 0 455long double fmodl(long double, long double); 456long double frexpl(long double value, int *); 457long double hypotl(long double, long double); 458#endif 459int ilogbl(long double); 460#if 0 461long double ldexpl(long double, int); 462long double lgammal(long double); 463long long llrintl(long double); 464long long llroundl(long double); 465long double log10l(long double); 466long double log1pl(long double); 467long double log2l(long double); 468long double logbl(long double); 469long double logl(long double); 470long lrintl(long double); 471long lroundl(long double); 472long double modfl(long double, long double *); 473long double nanl(const char *); 474long double nearbyintl(long double); 475long double nextafterl(long double, long double); 476double nexttoward(double, long double); 477float nexttowardf(float, long double); 478long double nexttowardl(long double, long double); 479long double powl(long double, long double); 480long double remainderl(long double, long double); 481long double remquol(long double, long double, int *); 482long double rintl(long double); 483long double roundl(long double); 484long double scalblnl(long double, long); 485long double scalbnl(long double, int); 486long double sinhl(long double); 487long double sinl(long double); 488long double sqrtl(long double); 489long double tanhl(long double); 490long double tanl(long double); 491long double tgammal(long double); 492long double truncl(long double); 493#endif 494 495#endif /* __ISO_C_VISIBLE >= 1999 */ 496__END_DECLS 497 498#endif /* !_MATH_H_ */
| 436long double copysignl(long double, long double); 437#if 0 438long double coshl(long double); 439long double cosl(long double); 440long double erfcl(long double); 441long double erfl(long double); 442long double exp2l(long double); 443long double expl(long double); 444long double expm1l(long double); 445#endif 446long double fabsl(long double); 447long double fdiml(long double, long double); 448long double floorl(long double); 449#if 0 450long double fmal(long double, long double, long double); 451#endif 452long double fmaxl(long double, long double) __pure2; 453long double fminl(long double, long double) __pure2; 454#if 0 455long double fmodl(long double, long double); 456long double frexpl(long double value, int *); 457long double hypotl(long double, long double); 458#endif 459int ilogbl(long double); 460#if 0 461long double ldexpl(long double, int); 462long double lgammal(long double); 463long long llrintl(long double); 464long long llroundl(long double); 465long double log10l(long double); 466long double log1pl(long double); 467long double log2l(long double); 468long double logbl(long double); 469long double logl(long double); 470long lrintl(long double); 471long lroundl(long double); 472long double modfl(long double, long double *); 473long double nanl(const char *); 474long double nearbyintl(long double); 475long double nextafterl(long double, long double); 476double nexttoward(double, long double); 477float nexttowardf(float, long double); 478long double nexttowardl(long double, long double); 479long double powl(long double, long double); 480long double remainderl(long double, long double); 481long double remquol(long double, long double, int *); 482long double rintl(long double); 483long double roundl(long double); 484long double scalblnl(long double, long); 485long double scalbnl(long double, int); 486long double sinhl(long double); 487long double sinl(long double); 488long double sqrtl(long double); 489long double tanhl(long double); 490long double tanl(long double); 491long double tgammal(long double); 492long double truncl(long double); 493#endif 494 495#endif /* __ISO_C_VISIBLE >= 1999 */ 496__END_DECLS 497 498#endif /* !_MATH_H_ */
|